home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir41 / timstk11.zip / MANUAL.TXT < prev    next >
Text File  |  1993-04-01  |  190KB  |  5,267 lines

  1.  
  2.  
  3.  
  4.  
  5.          BE, Inc.
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.                                                    T i m e S t a c k  (TM)
  24.  
  25.                                                               Version 1.10
  26.  
  27.  
  28.  
  29.  
  30.                    The Ultimate Software Timing and Stack Analysis Utility
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.                                                              April 1, 1993
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.                                  _______
  47.                             ____|__     |               (R)
  48.                          --|       |    |-------------------
  49.                            |   ____|__  |  Association of
  50.                            |  |       |_|  Shareware
  51.                            |__|   o   |    Professionals
  52.                          -----|   |   |---------------------
  53.                               |___|___|    MEMBER
  54.  
  55.  
  56.  
  57.  
  58.  
  59.                      "We provide answers you never had before"
  60.  
  61.  
  62.  
  63.  
  64.          TimeStack User's Guide
  65.          Copyright 1993 by BE, Inc.
  66.          All Rights Reserved
  67.  
  68.  
  69.          The information in this document is subject to change without
  70.          notice and does not represent a commitment on the part of BE,
  71.          Inc.
  72.  
  73.  
  74.  
  75.          BE, INC. MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS
  76.          MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  77.          OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. BE, INC.
  78.          SHALL NOT BE LIABLE FOR ERRORS CONTAINED HEREIN OR FOR INCIDENTAL
  79.          OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE PERFORMANCE OF
  80.          SERVICES USING THIS MATERIAL. THE ENTIRE RISK AS TO THE QUALITY
  81.          AND PERFORMANCE OF THE SOFTWARE IS WITH THE USER., INCLUDING BUT
  82.          NOT LIMITED TO LOSS OF PROFIT, AND SPECIAL, INCIDENTAL,
  83.          CONSEQUENTIAL, OR OTHER SIMILAR CLAIMS.
  84.  
  85.  
  86.  
  87.          U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND. Use, duplication, or
  88.          disclosure by the Government is subject to restrictions as set
  89.          forth in subparagraph (c)(1)(ii) of the Rights in Technical Data
  90.          and Computer Software clause at DFARS 252.227-7013.
  91.  
  92.  
  93.  
  94.          All BE, Inc. products are trademarks or registered trademarks of
  95.          BE, Inc. Other brand and product names are trademarks or
  96.          registered trademarks of their respective holders.
  97.  
  98.  
  99.  
  100.  
  101.  
  102.          BE, Inc.
  103.          P.O. Box 29419
  104.          Indianapolis, IN  46229-0419          TimeStack User's Guide                          Table Of Contents
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.          Table Of Contents
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.          Table Of Contents                                               i
  129.  
  130.          Introduction                                                    1
  131.               Welcome to TimeStack.......................................1
  132.               What Is TimeStack..........................................1
  133.               Why TimeStack Is Unique....................................2
  134.               What TimeStack Does Not Do.................................2
  135.               The User's Guide...........................................2
  136.               Definition Of Shareware....................................3
  137.               The Association of Shareware Professionals (ASP)...........4
  138.               Registration Information...................................4
  139.               How To Contact BE, Inc.....................................5
  140.  
  141.          Chapter One - Starting Up                                       6
  142.               System Requirements........................................6
  143.               Installation...............................................6
  144.                    Configuring AUTOEXEC.BAT..............................7
  145.               Command Line Syntax........................................7
  146.               Loading and Running TimeStack..............................8
  147.  
  148.          Chapter Two - Menus and Windows                                 9
  149.               Screen Layout..............................................9
  150.               Menus.....................................................10
  151.                    How the menu works...................................10
  152.                    Status line..........................................11
  153.                    Entering filenames or text...........................11
  154.                    Entering numbers and addresses.......................12
  155.               Menu Selections...........................................13
  156.                    File.................................................13
  157.                         Load............................................13
  158.                         Restore.........................................13
  159.  
  160.  
  161.  
  162.                                          i          TimeStack User's Guide                          Table Of Contents
  163.  
  164.  
  165.  
  166.                         Save............................................13
  167.                         Get.............................................14
  168.                         Put.............................................14
  169.                    Analysis.............................................14
  170.                    Edit.................................................15
  171.                         Conditional branches............................15
  172.                         Jump to subroutine..............................15
  173.                         Jump indirect...................................16
  174.                    Clear................................................16
  175.                    Disasm...............................................16
  176.                    Options..............................................16
  177.                         Type of processor...............................16
  178.                         Clock rate......................................16
  179.                         Divisor for clock...............................17
  180.                         Get.............................................17
  181.                         1. Config.......................................17
  182.                         2. Node.........................................17
  183.                    Print................................................17
  184.                         Comment.........................................18
  185.                         1. Path to File.................................18
  186.                         2. Disasm to File...............................18
  187.                         3. Path to Printer..............................18
  188.                         4. Disasm to Printer............................18
  189.                    Quit.................................................19
  190.               Windows...................................................19
  191.                    Selecting a window...................................19
  192.                    Moving and sizing a window...........................19
  193.                    Display of subroutines...............................20
  194.               Windows Displayed.........................................20
  195.                    1 - Special Nodes....................................20
  196.                    2 - Disassembly......................................20
  197.                    3 - Analysis Results.................................21
  198.                    4 - Maximum Execution................................21
  199.                    5 - Minimum Execution................................22
  200.                    6 - Stack Depth......................................22
  201.               Special Keys..............................................22
  202.                    Function keys........................................22
  203.                    Hot keys.............................................23
  204.                    Other keys...........................................23
  205.               On-Line Help..............................................24
  206.  
  207.          Chapter Three - Understanding TimeStack                        25
  208.               Assembly Language Formats.................................25
  209.                    Differences in mnemonics.............................26
  210.                    Demo program limitations.............................27
  211.               Hex Files.................................................27
  212.                    Motorola hex files...................................28
  213.                    Intel hex files......................................28
  214.                    Possible errors......................................29
  215.               Program Listings..........................................29
  216.               Configuration Files.......................................29
  217.  
  218.  
  219.  
  220.                                         ii          TimeStack User's Guide                          Table Of Contents
  221.  
  222.  
  223.  
  224.               Node Files................................................30
  225.               Temporary Files...........................................30
  226.               Start and Stop Addresses..................................30
  227.               Timing Concepts...........................................31
  228.               Conditional Branches......................................31
  229.                    Take.................................................31
  230.                    Fall.................................................32
  231.                    Normal...............................................32
  232.               Program Loops.............................................32
  233.               Subroutines...............................................34
  234.               Jump Indirect.............................................35
  235.               Stack Depth...............................................35
  236.  
  237.          Chapter Four - Tutorial                                        36
  238.               Look at Listing...........................................36
  239.               Invoking Program..........................................36
  240.               Configuring TimeStack.....................................37
  241.               Load the Hex File.........................................37
  242.               Timing Subroutines........................................38
  243.               Timing Subroutines with Conditional Branches..............39
  244.               Timing Loops..............................................41
  245.                    Simple loop..........................................41
  246.                    Loop with middle exit................................42
  247.               Printing the Results......................................43
  248.               Quitting the Program......................................44
  249.  
  250.          Chapter Five - Timing Strategies                               45
  251.               Have a Listing Ready......................................45
  252.               What Units to Use.........................................45
  253.               Start Small...............................................45
  254.               Be Realistic..............................................46
  255.               More Than One Path........................................47
  256.  
  257.          Chapter Six - Advanced Tutorial                                48
  258.               Invoke Program Again......................................48
  259.               Complex Loops.............................................48
  260.               Indirect Jump.............................................50
  261.               Untimeable Instructions...................................51
  262.               Illegal Instructions......................................51
  263.               Nested Loops..............................................52
  264.                    Loops inside subroutines.............................52
  265.                    Loops inside other loops.............................54
  266.               Subroutines with Different Execution Times................55
  267.               Stack Imbalance...........................................56
  268.               Infinite Loops............................................57
  269.                    Memory limitations...................................58
  270.               Branch Past Stop Address..................................58
  271.               Actual Stop Address.......................................59
  272.               Forcing Conditional Branches..............................60
  273.               Save to File..............................................60
  274.               High Level Languages......................................60
  275.  
  276.  
  277.  
  278.                                         iii          TimeStack User's Guide                          Table Of Contents
  279.  
  280.  
  281.  
  282.          Appendix A - Listing of Demo Program                           61
  283.  
  284.          Appendix B - Warning and Error Messages                        69
  285.               Warning Messages..........................................69
  286.               Error Messages............................................70
  287.  
  288.          Appendix C - Key Summary                                       74
  289.  
  290.          Appendix D - Processor Specifics                               76
  291.               TSDEMO....................................................76
  292.               TS6811....................................................77
  293.               TS6805....................................................78
  294.               TS8051....................................................79
  295.               TS8048....................................................80
  296.  
  297.          Index                                                          81
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.                                         iv          TimeStack User's Guide                               Introduction
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.          Introduction
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.          Welcome to TimeStack
  362.  
  363.                    Thank you for your purchase of TimeStack. Your days of
  364.                    counting opcode cycles and looking for instructions
  365.                    that push data on the stack are over. You will now be
  366.                    able to quickly document exactly how long an assembly
  367.                    language function takes to execute, find its worst
  368.                    stack depth usage, and check for stack imbalances!
  369.  
  370.  
  371.          What Is TimeStack
  372.  
  373.                    TimeStack is a better way to time and analyze your
  374.                    real-time assembly language programs.
  375.  
  376.                    It is beneficial in real-time assembly language
  377.                    programs to know four things.
  378.  
  379.                    * The absolute theoretical maximum execution time,
  380.  
  381.                    * minimum execution time,
  382.  
  383.                    * worst stack depth, and
  384.  
  385.                    * stack imbalances.
  386.  
  387.                    It is also beneficial to see how these paths were
  388.                    achieved. This allows proving that a program will
  389.                    execute within its limitations. TimeStack gives you
  390.                    this information.
  391.  
  392.  
  393.  
  394.                                          1          TimeStack User's Guide                               Introduction
  395.  
  396.  
  397.  
  398.          Why TimeStack Is Unique
  399.  
  400.                    Until now, execution time and stack depth had to be
  401.                    calculated by hand. TimeStack eliminates this drudgery.
  402.  
  403.                    Using a simulator to verify timing is much harder than
  404.                    using it to do a functional test of a program. It is a
  405.                    long and tedious task to configure the inputs of a
  406.                    simulator to time the path that is thought to be the
  407.                    longest executing. TimeStack is better than a simulator
  408.                    for timings because all possible combinations of
  409.                    branches are examined.
  410.  
  411.                    Some of the features that make TimeStack easy to use
  412.                    are pull down menus, hot keys, and multiple windows for
  413.                    display of information.
  414.  
  415.                    It includes the ability to disassemble, send the
  416.                    results of the analysis to a printer or file, and save
  417.                    its current configuration.
  418.  
  419.  
  420.          What TimeStack Does Not Do
  421.  
  422.                    TimeStack is not a simulator. If the program contains a
  423.                    loop, the user will need to assist TimeStack by
  424.                    indicating how many times the loop takes place. It does
  425.                    not know what has been loaded into processor registers.
  426.                    If a portion of the logic has special considerations
  427.                    based on a register or flag value (loop counters,
  428.                    indirect jumps, etc.,) they must be specified by the
  429.                    user.
  430.  
  431.  
  432.          The User's Guide
  433.  
  434.                    The User's Guide provides all of the information about
  435.                    TimeStack as well as examples.
  436.  
  437.                    Chapter One - Starting Up tells you how to install
  438.                    TimeStack on your system.
  439.  
  440.                    Chapter Two - Menus and Windows describes the screen
  441.                    layout and how to work the menu system.
  442.  
  443.                    Chapter Three - Understanding TimeStack goes into some
  444.                    background on what TimeStack needs to run and concepts
  445.                    involved with timing a program.
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.                                          2          TimeStack User's Guide                               Introduction
  453.  
  454.  
  455.  
  456.                    Chapter Four - Tutorial is an actual demonstration of
  457.                    how to analyze a simple program. Many of the concepts
  458.                    are shown.
  459.  
  460.                    Chapter Five - Timing Strategies discusses some of the
  461.                    things to keep in mind while timing.
  462.  
  463.                    Chapter Six - Advanced Tutorial expands on the
  464.                    demonstration by addressing more advanced topics.
  465.  
  466.                    Appendix A - Listing of Demo Program is the complete
  467.                    listing of the demonstration program used in the
  468.                    examples.
  469.  
  470.                    Appendix B - Warning and Error Messages lists and
  471.                    explains all warning and error messages that may be
  472.                    encountered, and suggests possible solutions.
  473.  
  474.                    Appendix C - Key Summary is a convenient reference for
  475.                    all function keys and hot keys.
  476.  
  477.                    Appendix D - Processor Specifics describes any special
  478.                    characteristics an individual processor may have.
  479.  
  480.  
  481.          Definition Of Shareware
  482.  
  483.                    TimeStack is a copyrighted program which is being
  484.                    marketed as shareware. It is not a public domain
  485.                    program and it is not free.
  486.  
  487.                    Shareware is a distribution method, not a type of
  488.                    software. The shareware system makes fitting your needs
  489.                    easier, because you can try before you buy. Shareware
  490.                    has the ultimate money-back guarantee - if you don't
  491.                    use the product, you don't pay for it.
  492.  
  493.                    Copyright laws apply to both shareware and commercial
  494.                    software, and the copyright holder retains all rights,
  495.                    with a few specific exceptions as stated later.
  496.                    Shareware authors are accomplished programmers and the
  497.                    programs are comparable in quality to commercial
  498.                    software (in both cases, there are good programs and
  499.                    bad ones). The main difference is in the method of
  500.                    distribution. The author specifically grants the right
  501.                    to copy and distribute the software, either to all and
  502.                    sundry or to a specific group. For example, some
  503.                    authors require written permission before a commercial
  504.                    disk vendor may copy their shareware.
  505.  
  506.  
  507.  
  508.  
  509.  
  510.                                          3          TimeStack User's Guide                               Introduction
  511.  
  512.  
  513.  
  514.          The Association of Shareware Professionals (ASP)
  515.  
  516.                    The ASP is an association for shareware authors with
  517.                    the general goals of educating shareware authors and
  518.                    distributors and the public, setting standards, sharing
  519.                    resources and information among members.
  520.  
  521.                    Shareware produced by ASP members must meet minimum
  522.                    quality standards. The program must be fully
  523.                    functional, not crippled, a demo, or out-of-date
  524.                    version. The documentation must be complete and clearly
  525.                    state the registration fee and the benefits of
  526.                    registering. ASP members must provide free mail or
  527.                    telephone support for a minimum of three months after
  528.                    registration. Also, members must follow other
  529.                    guidelines to insure that a user is dealt with
  530.                    professionally.
  531.  
  532.                    BE, Inc. is a member of the Association of Shareware
  533.                    Professionals (ASP). ASP wants to make sure that the
  534.                    shareware principle works for you. If you are unable to
  535.                    resolve a shareware-related problem with an ASP member
  536.                    by contacting the member directly, ASP may be able to
  537.                    help. The ASP Ombudsman can help you resolve a dispute
  538.                    or problem with an ASP member, but does not provide
  539.                    technical support for members' products. Please write
  540.                    to the ASP Ombudsman at 545 Grover Road, Muskegon, MI
  541.                    49442 or send a CompuServe message via CompuServe Mail
  542.                    to ASP Ombudsman 70007,3536.
  543.  
  544.  
  545.          Registration Information
  546.  
  547.                    TimeStack is provided at no charge to the user for
  548.                    evaluation. Feel free to share it with your friends,
  549.                    but do not give it away altered or as part of another
  550.                    system. The essence of "user-supported" software is to
  551.                    provide personal computer users with quality software
  552.                    without high prices, and yet to provide incentive for
  553.                    programmers to continue to develop new products.
  554.  
  555.                    BE, Inc. grants you a limited license to use TimeStack
  556.                    for evaluation purposes only for a period not to exceed
  557.                    30 days. If you intend to continue using TimeStack or
  558.                    its documentation after the 30-day evaluation period,
  559.                    you MUST make a registration payment to BE, Inc. Using
  560.                    TimeStack after the evaluation period has ended without
  561.                    registering is a violation of this limited license.
  562.  
  563.                    TimeStack may be registered by using the accompanying
  564.                    order form. You may also register using MasterCard or
  565.  
  566.  
  567.  
  568.                                          4          TimeStack User's Guide                               Introduction
  569.  
  570.  
  571.  
  572.                    Visa by phone (1-800-628-9085). Site licenses and
  573.                    volume discount arrangements may be made by contacting
  574.                    BE, Inc. Company purchase orders are welcomed.
  575.  
  576.                    The $129.95 registration fee will license one copy for
  577.                    use on any one computer at any one time. Additional
  578.                    sites or additional computers on a local area network
  579.                    must be licensed separately. If you have any questions
  580.                    please contact BE, Inc.
  581.  
  582.                    Registered users will receive:
  583.  
  584.                    * The complete TimeStack package including typeset
  585.                      manual.
  586.  
  587.                    * The most current version of TimeStack. BE, Inc. is
  588.                      continuously improving its products and registration
  589.                      ensures that you have the latest version.
  590.  
  591.                    * Free technical support.
  592.  
  593.                    * Notification of significant upgrades to TimeStack.
  594.  
  595.  
  596.          How To Contact BE, Inc.
  597.  
  598.                    When you register your software, you allow us to give
  599.                    you the kind of support you deserve. You may contact us
  600.                    by mail, by telephone, or on CompuServe.
  601.  
  602.                    BE, Inc.
  603.                    P.O. Box 29419
  604.                    Indianapolis, IN  46229-0419
  605.                    (317) 894-7021
  606.                    1-800-628-9085 (orders only)
  607.  
  608.                    CompuServe [70353,2665]
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.                                          5          TimeStack User's Guide                  Chapter One - Starting Up
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.          Chapter One - Starting Up
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.          System Requirements
  652.  
  653.                    TimeStack requires the following system configuration:
  654.  
  655.                    * IBM Personal Computer or a compatible,
  656.  
  657.                    * at least 512K of RAM,
  658.  
  659.                    * DOS Version 2.1 or greater,
  660.  
  661.                    * a hard disk drive or floppy disk drive, and
  662.  
  663.                    * IBM PC compatible video adapter.
  664.  
  665.                    For fastest operation, a computer of at least an IBM-AT
  666.                    class machine is preferred. Of course, TimeStack will
  667.                    work with lesser models, but with a degradation in
  668.                    operating speed.
  669.  
  670.  
  671.          Installation
  672.  
  673.                    Before you install TimeStack, please read the
  674.                    information in the README file. The README file
  675.                    contains any last minute information that is not
  676.                    contained in this manual.
  677.  
  678.                    Installation is fairly simple. All of the files on the
  679.                    TimeStack Program disk(s) are copied to a subdirectory
  680.                    on a hard disk or copied to a separate floppy disk.
  681.  
  682.  
  683.  
  684.                                          6          TimeStack User's Guide                  Chapter One - Starting Up
  685.  
  686.  
  687.  
  688.                    * Prepare the destination that is to receive the
  689.                      TimeStack files. This could be another floppy disk
  690.                      or a subdirectory on the hard disk.
  691.  
  692.                    * Insert the TimeStack Program disk to be installed
  693.                      into the floppy disk drive.
  694.  
  695.                    * Copy all the files from the TimeStack Program disk
  696.                      to the desired destination. The commands usually
  697.                      look like this:
  698.  
  699.                         MD C:\TS
  700.                         COPY A:*.* C:\TS
  701.  
  702.                    * Do this for each disk that is to be installed. The
  703.                      TimeStack files are not sensitive to the directory
  704.                      that they are placed.
  705.  
  706.  
  707.                  Configuring AUTOEXEC.BAT
  708.  
  709.                    At the end of installation, you may find it convenient
  710.                    to have DOS automatically search the directory that
  711.                    contains the TimeStack files. DOS searches for a file
  712.                    called AUTOEXEC.BAT when you start your computer. It
  713.                    performs any commands that you might place in it.
  714.  
  715.                    One useful command is PATH. It tells DOS which
  716.                    directories to search for executable commands after it
  717.                    has searched the current working directory. The command
  718.                    to have it search the TimeStack directory just created
  719.                    might look something like this:
  720.  
  721.                         PATH C:\TS
  722.  
  723.                    If there are other directories already specified in the
  724.                    PATH command, the TimeStack directory should be placed
  725.                    at the end. A semicolon separates each directory
  726.                    specified in the list:
  727.  
  728.                         PATH C:\DOS;C:\BIN;C:\TS
  729.  
  730.  
  731.          Command Line Syntax
  732.  
  733.                    The name of the executable program that is typed at the
  734.                    command line is different for each family of
  735.                    processors. The generic command-line syntax for running
  736.                    TimeStack is:
  737.  
  738.                    TSxxxx
  739.  
  740.  
  741.  
  742.                                          7          TimeStack User's Guide                  Chapter One - Starting Up
  743.  
  744.  
  745.  
  746.                    where xxxx is the name of the processor family.
  747.                    Currently, the valid program names are:
  748.  
  749.                    * TSDEMO  Demonstration program
  750.  
  751.                    * TS6811  Motorola 6800/1/2/3 and 68HC11 families
  752.  
  753.                    * TS6805  Motorola 6805 HMOS, HCMOS, and CMOS families
  754.  
  755.                    * TS8051  Intel 8051 families
  756.  
  757.                    * TS8048  Intel 8020/1 and 8048 families
  758.  
  759.  
  760.          Loading and Running TimeStack
  761.  
  762.                    If you are using a hard disk system, change to the
  763.                    directory where the TimeStack files are located. Type
  764.                    the program name at the DOS prompt and press Enter.
  765.  
  766.                    If you are operating from a floppy system, place the
  767.                    TimeStack disk in the drive, change the current default
  768.                    drive to that drive, type the program name, and press
  769.                    Enter.
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.                                          8          TimeStack User's Guide            Chapter Two - Menus and Windows
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.          Chapter Two - Menus and Windows
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.          Screen Layout
  826.  
  827.                    The screen as displayed in its default configuration
  828.                    has two major parts. The single line at the top is the
  829.                    main menu command bar. It is used to select the many
  830.                    different functions and includes a one-line help
  831.                    message about the currently selected item in a status
  832.                    line at the bottom. The rest of the screen contains the
  833.                    display windows with analysis information (see Figure
  834.                    2-1).
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.                                          9          TimeStack User's Guide            Chapter Two - Menus and Windows
  859.  
  860.  
  861.  
  862.  
  863.  
  864. File  Analysis  Edit  Clear  Disasm  Options  Print  Quit
  865. ____+----------------------------+________+------- 3 - Analysis Results -------+
  866. ____| Start address : 002F       |________| 68DEMO at 1 MHz / 4                |
  867. ____| Stop address :  FFFF       |________| 002F to 0043         Bytes 21      |
  868. ____+----------------------------+________| Stack now -2         max 0         |
  869. +---------- 1 - Special Nodes -----------+| Cycle min 16         max 26        |
  870. |  No special nodes                      ||       64.0 us        104.0 us      |
  871. |                                        ||                                    |
  872. |                                        |+------------------------------------+
  873. |                                        |+------ 4 - Maximum Execution -------+
  874. |                                        ||  1) 0030 : BCC   0038      FALL    |
  875. |                                        ||  2) 0036 : BCC   003D      TAKE    |
  876. |                                        ||  3) 003E : BCC   0043      FALL    |
  877. |                                        |+------------------------------------+
  878. +----------------------------------------++------ 5 - Minimum Execution -------+
  879. +----------- 2 - Disassembly ------------+|  1) 0030 : BCC   0038      TAKE    |
  880. |  No Disasm address entered             ||                                    |
  881. |                                        ||                                    |
  882. |                                        |+------------------------------------+
  883. |                                        |+--------- 6 - Stack Depth ----------+
  884. |                                        ||  1) 0030 : BCC   0038      FALL    |
  885. |                                        ||  2) 0036 : BCC   003D      FALL    |
  886. |                                        ||                                    |
  887. +----------------------------------------++------------------------------------+
  888. Analyze program from start to stop address
  889.  
  890.           Figure 2-1   Typical screen
  891.  
  892.  
  893.          Menus
  894.  
  895.                    The pull down menus are selected by using the cursor
  896.                    keys and pressing Enter. Another method is to press the
  897.                    first letter of the menu description.
  898.  
  899.  
  900.                  How the menu works
  901.  
  902.                    The TimeStack menu operates very much like most other
  903.                    popular menus.
  904.  
  905.                    Pressing Esc aborts the current operation and backs up
  906.                    one level in the menu. Thus, pressing Esc a multiple
  907.                    number of times will eventually return the cursor to
  908.                    the main menu.
  909.  
  910.                    The left and right arrow keys are used to move the
  911.                    highlight bar back and forth along the menu line.
  912.  
  913.  
  914.  
  915.  
  916.                                         10          TimeStack User's Guide            Chapter Two - Menus and Windows
  917.  
  918.  
  919.  
  920.                    Pressing Enter selects the menu item and pulls down the
  921.                    next menu or invokes whatever action should take place.
  922.  
  923.                    On the pull down menus, pressing the up and down arrow
  924.                    keys moves the highlight bar through the selections.
  925.                    Pressing Enter selects the menu item or invokes
  926.                    whatever action should take place.
  927.  
  928.                    The first letter of the menu item name may be pressed
  929.                    to select the menu item. Some menu items may be
  930.                    selected with a hot key which is described in Special
  931.                    Keys.
  932.  
  933.  
  934.                  Status line
  935.  
  936.                    The status line is located at the bottom of the screen.
  937.                    It is a single line that displays a simple description
  938.                    about the currently selected menu item. For further
  939.                    information on the current menu item, press F1 for
  940.                    help.
  941.  
  942.  
  943.                  Entering filenames or text
  944.  
  945.                    Filenames and text are entered in many different
  946.                    places. Both are entered using the same basic
  947.                    mechanism.
  948.  
  949.                    A prompt for a filename or text places a box on the
  950.                    screen just below the menu item that was picked to
  951.                    request the information. This box contains a
  952.                    description of what type of information should be
  953.                    entered. Below the description line is the line on
  954.                    which the information will be entered. This line will
  955.                    either start off empty or contain whatever information
  956.                    has previously been entered for that item.
  957.  
  958.                    If there was text that was previously entered and it is
  959.                    displayed, the cursor will be positioned at the end of
  960.                    it. The first keypress is very important. Pressing any
  961.                    alphanumerical key will clear this text and start a new
  962.                    entry with that key. Pressing any type of cursor
  963.                    movement key such as Home, End, Cur Left, Cur Right,
  964.                    Backspace, or Del will immediately start to edit the
  965.                    existing text.
  966.  
  967.                    If Esc is pressed before Enter is pressed, the original
  968.                    text is not changed. The Esc key is sort of an "oh-no"
  969.                    key. It lets you back out of a mistake before it's too
  970.                    late.
  971.  
  972.  
  973.  
  974.                                         11          TimeStack User's Guide            Chapter Two - Menus and Windows
  975.  
  976.  
  977.  
  978.                  Entering numbers and addresses
  979.  
  980.                    Numbers are entered the same way that text is entered.
  981.                    Any previously entered number is displayed and a new
  982.                    number may be typed in immediately or the old number
  983.                    may be edited. If Esc is pressed before Enter is
  984.                    pressed, the original number is not changed.
  985.  
  986.                    All numbers that are entered must fall in a certain
  987.                    range. If the new number that is entered falls outside
  988.                    of this range when Enter is pressed, the number just
  989.                    entered is erased and the old number is redisplayed.
  990.                    This is typically used to limit that maximum value that
  991.                    may be entered.
  992.  
  993.                    Information that requires a number to be entered will
  994.                    default to either decimal or hexadecimal without
  995.                    requiring any prefix or postfix characters. The default
  996.                    is logical for the value to be entered. Values that
  997.                    represent counts or number of times to do something are
  998.                    decimal numbers. Addresses are in hexadecimal.
  999.  
  1000.                    Upper and lower case is not significant when entering a
  1001.                    number. This is only relevant for hexadecimal numbers
  1002.                    and prefix or postfix characters.
  1003.  
  1004.                    The default number base may be overridden by using a
  1005.                    prefix or postfix. The two different prefixes that may
  1006.                    be used to force a decimal number base are:
  1007.  
  1008.                    * &       &123
  1009.  
  1010.                    * d'      d'123 or D'123
  1011.  
  1012.                    The five different prefixes that may be used to force a
  1013.                    hexadecimal number base are:
  1014.  
  1015.                    * $       $ABCD
  1016.  
  1017.                    * 0x      0xABCD or 0XABCD
  1018.  
  1019.                    * h'      h'ABCD or H'ABCD
  1020.  
  1021.                    * x'      x'ABCD or X'ABCD
  1022.  
  1023.                    * 0x'     0x'ABCD or 0X'ABCD
  1024.  
  1025.                    The postfix that may be used to force a hexadecimal
  1026.                    number base is:
  1027.  
  1028.                    * h       ABCDh or ABCDH
  1029.  
  1030.  
  1031.  
  1032.                                         12          TimeStack User's Guide            Chapter Two - Menus and Windows
  1033.  
  1034.  
  1035.  
  1036.          Menu Selections
  1037.  
  1038.                    This section provides a reference to each menu item and
  1039.                    prompt. It is arranged in the order that the menus
  1040.                    appear on the screen.
  1041.  
  1042.  
  1043.                  File
  1044.  
  1045.             ALT-F  The File menu lets you manipulate all files in
  1046.                    TimeStack. This includes loading the hex file, saving
  1047.                    and restoring the node list, and getting and putting
  1048.                    the configuration to disk.
  1049.  
  1050.                      Load
  1051.  
  1052.             ALT-L  This prompts the name of the hex file. The hex file is
  1053.                    given a default extension of .HEX if no extension is
  1054.                    entered. If an extension is not desired then enter the
  1055.                    name as NAME. with a period on the end.
  1056.  
  1057.                    The hex file may be Motorola or Intel hex format. For a
  1058.                    more complete discussion see the section titled Hex
  1059.                    Files.
  1060.  
  1061.                    The hex file is automatically loaded if a configuration
  1062.                    file is loaded and there is a hex file name specified
  1063.                    in its configuration.
  1064.  
  1065.                      Restore
  1066.  
  1067.             ALT-R  The node list file name is entered here. This name is
  1068.                    used to read in the special node list file. Any name
  1069.                    entered here will also be used by the menu File | Save
  1070.                    described next.
  1071.  
  1072.                    The node list file is given a default extension of .NOD
  1073.                    if no extension is entered. If an extension is not
  1074.                    desired then enter the name as NAME. with a period on
  1075.                    the end.
  1076.  
  1077.                    The node list file is automatically loaded if a
  1078.                    configuration file is loaded and there is a node list
  1079.                    file name specified.
  1080.  
  1081.                      Save
  1082.  
  1083.             ALT-S  This name is used to write out the special node list
  1084.                    file. The node list file name entered here is the same
  1085.                    name used in the menu File | Restore described above.
  1086.  
  1087.  
  1088.  
  1089.  
  1090.                                         13          TimeStack User's Guide            Chapter Two - Menus and Windows
  1091.  
  1092.  
  1093.  
  1094.                    The node list file is given a default extension of .NOD
  1095.                    if no extension is entered. If an extension is not
  1096.                    desired then enter the name as NAME. with a period on
  1097.                    the end.
  1098.  
  1099.                    The node list file is automatically saved if the
  1100.                    automatic node list file save feature is active in the
  1101.                    Options | 2. Node menu and there is a node list file
  1102.                    name specified.
  1103.  
  1104.                      Get
  1105.  
  1106.                    The configuration of TimeStack is read in from here.
  1107.                    Any name entered here will also be used by the menu
  1108.                    File | Put described next.
  1109.  
  1110.                    The configuration file is given a default extension of
  1111.                    .CFG if no extension is entered. If an extension is not
  1112.                    desired then enter the name as NAME. with a period on
  1113.                    the end.
  1114.  
  1115.                    If a configuration file that matches the name of the
  1116.                    program (i.e. TSDEMO.CFG for the demo program) is found
  1117.                    when TimeStack starts up, that configuration is
  1118.                    automatically loaded.
  1119.  
  1120.                      Put
  1121.  
  1122.                    The current TimeStack configuration is saved in this
  1123.                    file. The configuration file name entered here is the
  1124.                    same name used in the menu File | Get described above.
  1125.  
  1126.                    The configuration file is given a default extension of
  1127.                    .CFG if no extension is entered. If an extension is not
  1128.                    desired then enter the name as NAME. with a period on
  1129.                    the end.
  1130.  
  1131.                    The configuration is automatically saved if the
  1132.                    automatic configuration save feature is active in the
  1133.                    Options | 1. Config menu and there is a configuration
  1134.                    file name specified.
  1135.  
  1136.  
  1137.                  Analysis
  1138.  
  1139.             ALT-A  The start and stop addresses of the analysis to be done
  1140.                    are entered here. The cursor starts out on the top line
  1141.                    which is the start address. The hexadecimal start
  1142.                    address obtained from the program listing is entered
  1143.                    here.
  1144.  
  1145.  
  1146.  
  1147.  
  1148.                                         14          TimeStack User's Guide            Chapter Two - Menus and Windows
  1149.  
  1150.  
  1151.  
  1152.                    Pressing Enter moves to the stop address on the next
  1153.                    line. A hexadecimal stop address determined by
  1154.                    inspecting the program listing is entered. If the
  1155.                    analysis is on a procedure that finishes with a return
  1156.                    from subroutine instruction, enter a hexadecimal value
  1157.                    that contains all F's such as FFFF. The analysis will
  1158.                    automatically stop when it finds a return from
  1159.                    subroutine instruction. Pressing Esc from this line
  1160.                    restores the previous value and moves the cursor back
  1161.                    up to the start address line.
  1162.  
  1163.                    Once the analysis has started, it may be aborted by
  1164.                    pressing Esc. This causes a prompt to appear that asks
  1165.                    if you really want to abort.
  1166.  
  1167.  
  1168.                  Edit
  1169.  
  1170.             ALT-E  A prompt for the address of an instruction to be edited
  1171.                    is given.
  1172.  
  1173.                    The instructions that may be edited are conditional
  1174.                    branches, jumps to subroutines, jumps indirect, and
  1175.                    jumps to subroutines indirect. The type of instruction
  1176.                    will determine which menu is displayed next.
  1177.  
  1178.                      Conditional branches
  1179.  
  1180.                    The menu for conditional branches have the choices
  1181.                    Take, Fall, Normal, or Delete. The options Take and
  1182.                    Fall will prompt for a number that indicates how many
  1183.                    times to take or fall through a conditional branch. A
  1184.                    value of zero indicates that the branch should always
  1185.                    be taken or always fall through.
  1186.  
  1187.                      Jump to subroutine
  1188.  
  1189.                    The menu for jumps to subroutines and jumps to
  1190.                    subroutines indirect allow the maximum number of cycles
  1191.                    and maximum stack depth to be entered. The maximum
  1192.                    number of cycles will also be used for the minimum
  1193.                    number of cycles in the analysis and the outcome in the
  1194.                    Analysis Result window will be flagged to indicate the
  1195.                    minimum number of cycles and worst case stack depth may
  1196.                    not be accurate.
  1197.  
  1198.                    The largest value that may be entered for the maximum
  1199.                    number of cycles on a jump to subroutine is 65535. If
  1200.                    this proves to be a limitation it may be possible to
  1201.                    set its value to zero during the analysis and add the
  1202.                    desired maximum number to the result afterwards.
  1203.  
  1204.  
  1205.  
  1206.                                         15          TimeStack User's Guide            Chapter Two - Menus and Windows
  1207.  
  1208.  
  1209.  
  1210.                      Jump indirect
  1211.  
  1212.                    The menu for jump indirect first displays the option to
  1213.                    handle the jump indirect exactly as it would a return
  1214.                    from subroutine instruction. If this is not chosen then
  1215.                    the address that should be jumped to is prompted for.
  1216.  
  1217.  
  1218.                  Clear
  1219.  
  1220.             ALT-C  It is possible to clear nodes in the Special Nodes
  1221.                    window one at a time using the Edit menu but this is
  1222.                    time consuming. This option allows clearing all nodes
  1223.                    from the given starting address through the given
  1224.                    ending address inclusive.
  1225.  
  1226.  
  1227.                  Disasm
  1228.  
  1229.             ALT-D  The Disassembly window needs to know where to start
  1230.                    when it disassembles a portion of the program. Enter
  1231.                    the starting address for disassembly here.
  1232.  
  1233.  
  1234.                  Options
  1235.  
  1236.             ALT-O  There are many different options available so that you
  1237.                    may customize your operation of TimeStack.
  1238.  
  1239.                      Type of processor
  1240.  
  1241.                    The type of processor is picked in this menu. This can
  1242.                    have an effect on what opcodes are illegal and how many
  1243.                    clock cycles an opcode uses. Some processor families
  1244.                    have a large number of choices. This may mean a
  1245.                    difference in timing characteristics or it may just
  1246.                    allow the specific processor name to be chosen for
  1247.                    display purposes. Appendix D will indicate the reason.
  1248.  
  1249.                    Any time a processor is picked, the clock divisor value
  1250.                    is reset to a default value for that processor.  See
  1251.                    the Options | Divisor menu.
  1252.  
  1253.                      Clock rate
  1254.  
  1255.                    The clock rate of the processor is entered here. This
  1256.                    is used to calculate how many microseconds the maximum
  1257.                    and minimum execution times are in the Analysis Results
  1258.                    window.
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.                                         16          TimeStack User's Guide            Chapter Two - Menus and Windows
  1265.  
  1266.  
  1267.  
  1268.                    The number entered is in megahertz. It must be between
  1269.                    0 and 200 MHz. It is a floating point number with at
  1270.                    least five digits of accuracy. It may be entered as a
  1271.                    regular number or using scientific notation.
  1272.  
  1273.                      Divisor for clock
  1274.  
  1275.                    Every processor has a factor that the external clock
  1276.                    input is divided by. The external clock is divided by
  1277.                    this value to obtain an internal clock that is referred
  1278.                    to as the cycle time.
  1279.  
  1280.                    Most processors have a fixed value for this internal
  1281.                    divisor and this may be found in Appendix D. This
  1282.                    default value may be changed using this menu. Normally
  1283.                    this would only be done if the processor has a special
  1284.                    customized selection for different divisors.
  1285.  
  1286.                    This value is reset to a default value any time a
  1287.                    processor is selected using the Options | Type menu.
  1288.  
  1289.                    The number entered must be between 0 and 256. It is a
  1290.                    floating point number with at least five digits of
  1291.                    accuracy. It may be entered as a regular number or
  1292.                    using scientific notation.
  1293.  
  1294.                      Get
  1295.  
  1296.                    You may get additional information on the current state
  1297.                    of TimeStack. This includes file names, current
  1298.                    processor type, clock rate, clock divisor, and memory
  1299.                    available.
  1300.  
  1301.                      1. Config
  1302.  
  1303.                    This option allows the configuration to be saved
  1304.                    automatically when the Quit menu is invoked.
  1305.  
  1306.                      2. Node
  1307.  
  1308.                    This option allows the node list to be saved
  1309.                    automatically when the Quit menu is invoked.
  1310.  
  1311.  
  1312.                  Print
  1313.  
  1314.             ALT-P  The information obtained from the analysis may be saved
  1315.                    in a file on disk or sent to a printer.
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.                                         17          TimeStack User's Guide            Chapter Two - Menus and Windows
  1323.  
  1324.  
  1325.  
  1326.                      Comment
  1327.  
  1328.                    A line at the top of the printed information may
  1329.                    optionally contain a comment. That line is entered here
  1330.                    and it remains until replaced with another line.
  1331.  
  1332.                      1. Path to File
  1333.  
  1334.                    Outputs the current analysis results, maximum
  1335.                    execution, minimum execution, and stack depth paths to
  1336.                    a file. This file is usually saved for printing later.
  1337.  
  1338.                      2. Disasm to File
  1339.  
  1340.                    Outputs the disassembled program to a file that is
  1341.                    usually saved for printing later. The range that is
  1342.                    disassembled begins at the analysis start address and
  1343.                    finishes at the analysis end address.
  1344.  
  1345.                      3. Path to Printer
  1346.  
  1347.                    Same as Print | 1. Path to File except the output is
  1348.                    directed to the DOS print device PRN.
  1349.  
  1350.                    Before the printing starts, a message is displayed that
  1351.                    says to prepare the printer. When the printer is ready
  1352.                    press Enter.
  1353.  
  1354.                    To abort the print before it begins press Esc.
  1355.  
  1356.                    When Enter is pressed another message is displayed that
  1357.                    indicates printing is in progress. Esc may also be
  1358.                    pressed at any time to halt the printing.
  1359.  
  1360.                    A warning is displayed if a problem is encountered
  1361.                    communicating with the printer. Typically this is some
  1362.                    simple condition such as turning the printer on,
  1363.                    checking to see that it has paper, and that it is on-
  1364.                    line. Press Enter to try again after the problem has
  1365.                    been fixed. Printing may also be aborted at this point
  1366.                    by pressing Esc.
  1367.  
  1368.                      4. Disasm to Printer
  1369.  
  1370.                    Same as Print | 2. Disasm to File except the output is
  1371.                    directed to the DOS print device PRN.
  1372.  
  1373.                    The printer operation is the same as 3. Path to
  1374.                    Printer.
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.                                         18          TimeStack User's Guide            Chapter Two - Menus and Windows
  1381.  
  1382.  
  1383.  
  1384.                  Quit
  1385.  
  1386.             ALT-Q  Quit the TimeStack program. If the Special Nodes have
  1387.                    been modified in any way and the save special nodes
  1388.                    automatically feature is not active, a prompt is given
  1389.                    to ask if the information should really be saved.
  1390.  
  1391.  
  1392.          Windows
  1393.  
  1394.                    The majority of the screen contains six windows. These
  1395.                    windows display a variety of information about the
  1396.                    analysis. One displays the results of the most recent
  1397.                    analysis. Other windows show the paths that were taken
  1398.                    to achieve those results. Another window contains a
  1399.                    list of all nodes that have been programmed and the
  1400.                    last displays the disassembled program.
  1401.  
  1402.  
  1403.                  Selecting a window
  1404.  
  1405.                    Each of the six individual windows may be selected at
  1406.                    any time. A selected window has a border with two lines
  1407.                    around it. All other windows have a single line. In
  1408.                    Figure 2-1 on page 10, window 1 - Special Nodes is
  1409.                    currently selected.
  1410.  
  1411.                    To select another window, press F3, F4, or ALT-1
  1412.                    through ALT-6. The key F3 makes the next window active,
  1413.                    F4 makes the previous window active, and ALT-1 through
  1414.                    ALT-6 selects the corresponding window by its number
  1415.                    directly.
  1416.  
  1417.                    Some windows selected may be able to scroll using the
  1418.                    cursor keys. See the specific description of the
  1419.                    windows below.
  1420.  
  1421.  
  1422.                  Moving and sizing a window
  1423.  
  1424.                    To move or size a window, press F6. This activates a
  1425.                    mode that allows the window to be moved or sized using
  1426.                    the Cur Up and Cur Dn keys. Pressing End toggles into
  1427.                    and out of a mode that allows changing the size of a
  1428.                    window. Press End once to enter the change size mode.
  1429.                    Use the Cur Up and Cur Dn keys to move the lower right
  1430.                    hand corner of the window to make it the desired size.
  1431.                    Press End to toggle back into the move window mode or
  1432.                    press F6 when the window is in the location and size
  1433.                    desired.
  1434.  
  1435.  
  1436.  
  1437.  
  1438.                                         19          TimeStack User's Guide            Chapter Two - Menus and Windows
  1439.  
  1440.  
  1441.  
  1442.                  Display of subroutines
  1443.  
  1444.                    Conditional branches inside of subroutines called with
  1445.                    a jump subroutine instruction are not displayed to
  1446.                    avoid clutter. If the branching information for a
  1447.                    subroutine is desired then the subroutine may be
  1448.                    analyzed separately.
  1449.  
  1450.  
  1451.          Windows Displayed
  1452.  
  1453.                    These are the windows that may be displayed.
  1454.  
  1455.  
  1456.                  1 - Special Nodes
  1457.  
  1458.                    This window displays the current list of special nodes.
  1459.                    A node is a conditional branch, a subroutine call, or a
  1460.                    jump, branch or subroutine call that uses an indirect
  1461.                    addressing mode.
  1462.  
  1463.                    Each entry in the list of special nodes displays its
  1464.                    position in the list, the address where it is located,
  1465.                    the disassembled mnemonic, and any special settings it
  1466.                    may have such as TAKE or FALL.
  1467.  
  1468.                    This information may be saved and restored from the
  1469.                    menu File | Save and File | Restore.
  1470.  
  1471.                    The keys Home, CTRL-Home, End, CTRL-End, Pg Up, Pg Dn,
  1472.                    Cur Up, Cur Dn, CTRL-Pg Up, CTRL-Pg Dn, F2, and F6 work
  1473.                    as described in Special Keys when this window is
  1474.                    selected.
  1475.  
  1476.  
  1477.                  2 - Disassembly
  1478.  
  1479.                    This window displays a disassembled portion of the
  1480.                    currently loaded program starting at the given address.
  1481.  
  1482.                    It is not possible to page in front of the address
  1483.                    entered to begin disassembly. This is because it is
  1484.                    impossible to figure out where opcode boundaries are
  1485.                    when moving backwards.
  1486.  
  1487.                    The keys Home, CTRL-Home, End, CTRL-End, Pg Up, Pg Dn,
  1488.                    Cur Up, Cur Dn, CTRL-Pg Up, CTRL-Pg Dn, F2, and F6 work
  1489.                    as described in Special Keys when this window is
  1490.                    selected.
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.                                         20          TimeStack User's Guide            Chapter Two - Menus and Windows
  1497.  
  1498.  
  1499.  
  1500.                    If the window is made wider it is possible to see
  1501.                    additional information about each instruction. There
  1502.                    are three columns that contain the following
  1503.                    information in this order:
  1504.  
  1505.                    * number of bytes,
  1506.  
  1507.                    * number of cycles, and
  1508.  
  1509.                    * amount of stack used.
  1510.  
  1511.  
  1512.                  3 - Analysis Results
  1513.  
  1514.                    The Analysis Results window shows the results from the
  1515.                    most recent analysis that has been run. It displays the
  1516.                    start address entered. The stop address displayed is
  1517.                    either the one entered or the one found.
  1518.  
  1519.                    The number of bytes is useful for quickly determining
  1520.                    the size of a procedure. The number of bytes is
  1521.                    calculated as:
  1522.  
  1523.                         Stop address - Start address + opcode size at Stop
  1524.                         address
  1525.  
  1526.                    The maximum and minimum cycle time differences are
  1527.                    caused by conditional branches. The minimum cycle time
  1528.                    is flagged with a + if any conditional branches that
  1529.                    are forced to always take or fall through or a user
  1530.                    defined jump to subroutine is encountered.
  1531.  
  1532.                    The maximum stack depth is flagged with a + if any
  1533.                    conditional branches that are forced to always take or
  1534.                    fall through are encountered. The stack depth now shows
  1535.                    the current stack pointer. It should normally show -2
  1536.                    after timing a subroutine ending with a return from
  1537.                    subroutine.
  1538.  
  1539.  
  1540.                  4 - Maximum Execution
  1541.  
  1542.                    This window shows the worst case execution path from
  1543.                    the most recent analysis.
  1544.  
  1545.                    The keys Home, CTRL-Home, End, CTRL-End, Pg Up, Pg Dn,
  1546.                    Cur Up, Cur Dn, CTRL-Pg Up, CTRL-Pg Dn, F2, and F6 work
  1547.                    as described in Special Keys when this window is
  1548.                    selected.
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.                                         21          TimeStack User's Guide            Chapter Two - Menus and Windows
  1555.  
  1556.  
  1557.  
  1558.                  5 - Minimum Execution
  1559.  
  1560.                    This window shows the best case execution path from the
  1561.                    most recent analysis.
  1562.  
  1563.                    The keys Home, CTRL-Home, End, CTRL-End, Pg Up, Pg Dn,
  1564.                    Cur Up, Cur Dn, CTRL-Pg Up, CTRL-Pg Dn, F2, and F6 work
  1565.                    as described in Special Keys when this window is
  1566.                    selected.
  1567.  
  1568.  
  1569.                  6 - Stack Depth
  1570.  
  1571.                    This window shows the worst case stack depth path from
  1572.                    the most recent analysis.
  1573.  
  1574.                    The keys Home, CTRL-Home, End, CTRL-End, Pg Up, Pg Dn,
  1575.                    Cur Up, Cur Dn, CTRL-Pg Up, CTRL-Pg Dn, F2, and F6 work
  1576.                    as described in Special Keys when this window is
  1577.                    selected.
  1578.  
  1579.  
  1580.          Special Keys
  1581.  
  1582.                    Some keys perform a specific function. They include
  1583.                    function keys and hot keys.
  1584.  
  1585.  
  1586.                  Function keys
  1587.  
  1588.                    The function keys with a special purpose are:
  1589.  
  1590.          F1        Obtains context sensitive on-line help. A window in the
  1591.                    middle of the screen is opened and additional
  1592.                    information relating specifically to the current menu
  1593.                    selection or error message is given.
  1594.  
  1595.          F2        Pulls down the Edit menu ready to edit the instruction
  1596.                    located at the address that is positioned on the top
  1597.                    line of the currently selected window. This allows for
  1598.                    quickly changing something that was located while
  1599.                    browsing the special nodes, disassembled program, or
  1600.                    one of the three paths.
  1601.  
  1602.          F3        Moves the currently selected window to the next one in
  1603.                    numerical order.
  1604.  
  1605.          F4        Moves the currently selected window to the previous one
  1606.                    in numerical order.
  1607.  
  1608.          F5        Reserved for future use.
  1609.  
  1610.  
  1611.  
  1612.                                         22          TimeStack User's Guide            Chapter Two - Menus and Windows
  1613.  
  1614.  
  1615.  
  1616.          F6        Allows moving the current window around and changing
  1617.                    its size on the screen.
  1618.  
  1619.  
  1620.                  Hot keys
  1621.  
  1622.                    Hot keys allow quick movement to a specific menu. All
  1623.                    of the items on the main menu can be reached by
  1624.                    pressing ALT followed by its first letter. The
  1625.                    currently defined hot keys are:
  1626.  
  1627.          ALT-A     Analysis
  1628.  
  1629.          ALT-C     Clear
  1630.  
  1631.          ALT-D     Disasm
  1632.  
  1633.          ALT-E     Edit
  1634.  
  1635.          ALT-F     File
  1636.  
  1637.          ALT-L     File | Load
  1638.  
  1639.          ALT-O     Options
  1640.  
  1641.          ALT-P     Print
  1642.  
  1643.          ALT-Q     Quit
  1644.  
  1645.          ALT-R     File | Restore
  1646.  
  1647.          ALT-S     File | Save
  1648.  
  1649.          ALT-1 - ALT-6  Select the window with that number.
  1650.  
  1651.  
  1652.                  Other keys
  1653.  
  1654.          Home      Moves the current line to the beginning in the selected
  1655.                    window. When entering a filename, text, or number, it
  1656.                    moves the cursor to the first character in the line and
  1657.                    no longer affects the selected window.
  1658.  
  1659.          CTRL-Home Moves the current line to the beginning in the selected
  1660.                    window.
  1661.  
  1662.          End       Moves the current line to the end in the selected
  1663.                    window. When entering a filename, text, or number, it
  1664.                    moves the cursor to the last character in the line and
  1665.                    no longer affects the selected window.
  1666.  
  1667.  
  1668.  
  1669.  
  1670.                                         23          TimeStack User's Guide            Chapter Two - Menus and Windows
  1671.  
  1672.  
  1673.  
  1674.          CTRL-End  Moves the current line to the end in the selected
  1675.                    window.
  1676.  
  1677.          Pg Up     Moves the current line in the selected window up one
  1678.                    full window's worth.
  1679.  
  1680.          Pg Dn     Moves the current line in the selected window down one
  1681.                    window's worth.
  1682.  
  1683.          Cur Up    Moves the current line in the selected window up one
  1684.                    line. If a pull down menu is active, the highlight bar
  1685.                    will move to the previous item instead of affecting the
  1686.                    selected window.
  1687.  
  1688.          CTRL-Pg Up     Moves the current line in the selected window up
  1689.                    one line.
  1690.  
  1691.          Cur Dn    Moves the current line in the selected window down one
  1692.                    line. If a pull down menu is active, the highlight bar
  1693.                    will move to the next item instead of affecting the
  1694.                    selected window.
  1695.  
  1696.          CTRL-Pg Dn     Moves the current line in the selected window down
  1697.                    one line.
  1698.  
  1699.          Ins       Toggles insert mode when entering data.
  1700.  
  1701.          Del       Deletes the character at the cursor position.
  1702.  
  1703.          Backspace Deletes the character just in front of the cursor.
  1704.  
  1705.          Cur Left  Moves the cursor left one character.
  1706.  
  1707.          Cur Right Moves the cursor right one character.
  1708.  
  1709.  
  1710.          On-Line Help
  1711.  
  1712.                    On-Line help is available at any time by pressing F1.
  1713.                    This opens the help window which will contain
  1714.                    additional context sensitive information on the current
  1715.                    menu item.
  1716.  
  1717.                    Pressing F1 again or pressing Esc will exit the on-line
  1718.                    help.
  1719.  
  1720.                    If the description is large enough it may be necessary
  1721.                    to use Pg Up and Pg Dn to see all of it.
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.                                         24          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.          Chapter Three - Understanding TimeStack
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.                    Explaining assembly language programming is beyond the
  1753.                    scope of this guide. The reader should already be
  1754.                    familiar with assembly language programming. Detail is
  1755.                    provided in some areas so that programmers familiar
  1756.                    with only one microprocessor may understand the
  1757.                    examples and demo program that have been provided.
  1758.  
  1759.  
  1760.          Assembly Language Formats
  1761.  
  1762.                    Throughout this User's Guide there are many references
  1763.                    to, and examples of, assembly language programs.
  1764.                    Different manufacturers of microprocessors and
  1765.                    providers of assemblers have their own nuances when it
  1766.                    comes to the style of the assembly language source
  1767.                    code.
  1768.  
  1769.                    The format that a particular assembler uses for its
  1770.                    source code is of no consequence to TimeStack. It looks
  1771.                    only at the generated hex data output of the assembler
  1772.                    and accepts Intel or Motorola hex files.
  1773.  
  1774.                    This guide will use the following format in its
  1775.                    examples of assembly language programs:
  1776.  
  1777.                    * a label must be terminated by a colon and begin in
  1778.                      column one,
  1779.  
  1780.                    * the opcode field never starts in column one,
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.                                         25          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  1787.  
  1788.  
  1789.  
  1790.                    * there must be at least one space between the opcode
  1791.                      field and the operand field, and
  1792.  
  1793.                    * comments must begin with a semicolon.
  1794.  
  1795.                    All examples in this guide will use the Motorola 6800
  1796.                    assembly language mnemonics because it is generally
  1797.                    well known. Many of the other Motorola microprocessors
  1798.                    have similarities in mnemonics. Programmers of Intel
  1799.                    and other families of microprocessors should have no
  1800.                    problem understanding the concepts that the simple
  1801.                    examples will be showing.
  1802.  
  1803.                    Figure 3-1 is an example of a typical listing. The
  1804.                    first column is a line number. The second column is the
  1805.                    address that the instruction is located at. The next
  1806.                    bytes of data are the machine code for the opcode on
  1807.                    that line.
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.                    000001 0000          ;   Test procedure
  1814.                    000002 0000          ;
  1815.                    000003 0000          TEST:
  1816.                    000004 0000 8100              CMPA #0
  1817.                    000005 0002 2701              BEQ  SKIP
  1818.                    000006 0004 4F                CLRA
  1819.                    000007 0005 39       SKIP:    RTS
  1820.  
  1821.  
  1822.  
  1823.                    Figure 3-1   Typical Assembly Language Listing
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.                  Differences in mnemonics
  1831.  
  1832.                    There are probably as many different mnemonics as there
  1833.                    are different processor families. Here is a table of
  1834.                    the nomenclature used in this manual along with some of
  1835.                    the common processors available for TimeStack.
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.                                         26          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  1845.  
  1846.  
  1847.  
  1848.                                                  MOTOROLA     INTEL
  1849.                    DESCRIPTION                   6800 / 6805  8051 / 8048
  1850.                    Jump                          JMP          JMP
  1851.                    Jump indirect                 JMP 0,X      JMP @A+DPTR
  1852.                    Jump subroutine               JSR          CALL
  1853.                    Jump subroutine indirect      JSR 0,X
  1854.                    Return subroutine             RTS          RET
  1855.                    Branch relative               BRA          JMP
  1856.                    Conditional branch if zero    BEQ          JZ
  1857.                    Conditional branch if not     BNE          JNZ
  1858.                    zero
  1859.  
  1860.                    Many of the other opcodes have similar minor
  1861.                    differences.
  1862.  
  1863.  
  1864.                  Demo program limitations
  1865.  
  1866.                    The demonstration program that is included with
  1867.                    TimeStack is based on the Motorola 6811 processor. Some
  1868.                    things have been removed to make it smaller and thus it
  1869.                    has the following limitations:
  1870.  
  1871.                    * The opcodes that manipulate the B or D registers
  1872.                      have been removed.
  1873.  
  1874.                    * Any special opcodes such as MUL have been removed.
  1875.  
  1876.  
  1877.          Hex Files
  1878.  
  1879.                    TimeStack reads the hex file that represents a program
  1880.                    for use in its analysis. A hex file contains the ASCII
  1881.                    representation of bytes of information. Using a hex
  1882.                    file to save binary information that is loaded at
  1883.                    specific memory addresses is beneficial for a couple of
  1884.                    reasons. First, the starting address that a block of
  1885.                    data should be located is included. Second, each line
  1886.                    has a checksum. Third, a hex file is human readable.
  1887.  
  1888.                    The hex file name is entered on the File | Load menu.
  1889.  
  1890.                    There are many different hex file formats. The two most
  1891.                    popular formats are referred to as Motorola Hex and
  1892.                    Intel Hex.
  1893.  
  1894.                    TimeStack looks at the hex file and attempts to
  1895.                    determine if it is a Motorola or Intel hex file based
  1896.                    on the first couple of characters in each record. The
  1897.                    checksum is calculated and checked for each record. The
  1898.                    record is loaded into TimeStack and placed in a virtual
  1899.  
  1900.  
  1901.  
  1902.                                         27          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  1903.  
  1904.  
  1905.  
  1906.                    memory area at the address specified for it by the
  1907.                    record.
  1908.  
  1909.  
  1910.                  Motorola hex files
  1911.  
  1912.                    Motorola hex files are composed of records. There is
  1913.                    one record per line. Each line begins with the letter S
  1914.                    and are thus often referred to as S records. The next
  1915.                    letter is a number that indicates the type of S record.
  1916.                    Each byte of data is represented by two hex digits. The
  1917.                    first byte is the number of bytes that follow and its
  1918.                    value does not count itself. The next two bytes
  1919.                    represent a 16-bit address where the data bytes in the
  1920.                    current record should be located. The address is
  1921.                    followed by the data bytes. The last byte in the record
  1922.                    is the checksum and its value is calculated such that
  1923.                    the sum of all bytes in the record when truncated to a
  1924.                    one byte value have the hexadecimal value of FF.
  1925.  
  1926.                    If you were to look at an S record it might look
  1927.                    something like this.
  1928.  
  1929.                         S10D10500501014A26FC0926F839BF
  1930.  
  1931.                    Separating this into its different fields makes it
  1932.                    easier to see.
  1933.  
  1934.                         S1  0D  1050  05 01 01 4A 26 FC 09 26 F8 39  BF
  1935.  
  1936.                    S1 is the record type, 0D is the number of bytes (14
  1937.                    decimal), 1050 is the address that the data bytes 05,
  1938.                    01, ... 39 are placed, and BF is the checksum.
  1939.  
  1940.  
  1941.                  Intel hex files
  1942.  
  1943.                    Intel hex files are also composed of records, one
  1944.                    record per line. Each line begins with a colon. Each
  1945.                    byte of data is represented by two hex digits. The
  1946.                    first byte is the number of data bytes. That is
  1947.                    followed by two bytes that form a 16-bit address where
  1948.                    the data bytes should be placed. The next byte is the
  1949.                    record type. This is followed by the data bytes. Last
  1950.                    is the checksum, its value calculated so that the sum
  1951.                    of all bytes in the record comes out to a value of zero
  1952.                    when truncated to a single byte.
  1953.  
  1954.                    If you were to look at an Intel record it might look
  1955.                    something like this.
  1956.  
  1957.  
  1958.  
  1959.  
  1960.                                         28          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  1961.  
  1962.  
  1963.  
  1964.                         :0A0860006300FF63FF0063FFFF2247
  1965.  
  1966.                    Separating it into its different fields results in
  1967.                    this.
  1968.  
  1969.                         :  0A  0860  00  63 00 FF 63 FF 00 63 FF FF 22  47
  1970.  
  1971.                    Where 0A is the number of data bytes (10 decimal), 0860
  1972.                    is the address that the data bytes 63, 00, ... 22 are
  1973.                    placed, and 47 is the checksum.
  1974.  
  1975.  
  1976.                  Possible errors
  1977.  
  1978.                    The possible errors loading a hex file are:
  1979.  
  1980.                    * The file may not appear to be a hex file. This could
  1981.                      be cause by the first character in each line not
  1982.                      being the letter S or a colon.
  1983.  
  1984.                    * The checksum is incorrect. This would indicate a
  1985.                      fundamental problem with the hex file, perhaps a
  1986.                      problem in copying at some point or corrupt data.
  1987.  
  1988.  
  1989.          Program Listings
  1990.  
  1991.                    A program listing is required to do an analysis with
  1992.                    TimeStack. Program listings are produced by an
  1993.                    assembler. They show the absolute locations of the
  1994.                    generated object code for each assembly language
  1995.                    instruction.
  1996.  
  1997.                    They are needed because these addresses are entered by
  1998.                    the user so that analysis may take place.
  1999.  
  2000.  
  2001.          Configuration Files
  2002.  
  2003.                    Configuration files are used to save information about
  2004.                    TimeStack that is useful to restore when TimeStack is
  2005.                    executed in the future. Some of the things saved in a
  2006.                    configuration file are:
  2007.  
  2008.                    * Start and stop addresses
  2009.  
  2010.                    * Window size and location on the screen
  2011.  
  2012.                    * Processor type selected, clock rate, and clock
  2013.                      divisor.
  2014.  
  2015.  
  2016.  
  2017.  
  2018.                                         29          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  2019.  
  2020.  
  2021.  
  2022.                    The default name for a configuration file is the name
  2023.                    of the TimeStack executable with .CFG as an extension.
  2024.                    Thus, for the demo program the default name would be
  2025.                    TSDEMO.CFG. If the default configuration file is found
  2026.                    in the current working directory when TimeStack starts
  2027.                    up, it is automatically loaded.
  2028.  
  2029.  
  2030.          Node Files
  2031.  
  2032.                    Node files contain the information displayed in the
  2033.                    Special Nodes window. They are useful for saving any
  2034.                    special conditional branch setups or jump subroutine
  2035.                    instruction override information.
  2036.  
  2037.                    The file name is automatically given the extension .NOD
  2038.                    if none has been entered.
  2039.  
  2040.  
  2041.          Temporary Files
  2042.  
  2043.                    Temporary files are created in the current working
  2044.                    directory when TimeStack runs. At least 50K of free
  2045.                    disk space is needed to hold them.
  2046.  
  2047.                    The names of the temporary files created while running
  2048.                    are: MAXDATA.TMP, MINDATA.TMP, and STKDATA.TMP.
  2049.  
  2050.                    If there is no space to hold these files a fatal error
  2051.                    message is displayed and TimeStack returns to DOS.
  2052.  
  2053.  
  2054.          Start and Stop Addresses
  2055.  
  2056.                    The start and stop addresses are considered to be
  2057.                    inclusive in the analysis. They may also be the same
  2058.                    value, in which case only the single instruction at
  2059.                    that address is analyzed. If the instruction at the
  2060.                    stop address is a jump subroutine, the subroutine will
  2061.                    be included in the analysis results.
  2062.  
  2063.                    Even though the stop address may be less that the start
  2064.                    address, there are few, if any, practical reasons to do
  2065.                    this. Most processors and programs have a flow of
  2066.                    execution that moves toward increasing address values.
  2067.                    A stop address composed of all F's is special.
  2068.  
  2069.                    It tells TimeStack to look for a return from subroutine
  2070.                    instruction and stop the analysis when it is
  2071.                    encountered. The stop address and size of the procedure
  2072.  
  2073.  
  2074.  
  2075.  
  2076.                                         30          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  2077.  
  2078.  
  2079.  
  2080.                    displayed in the Analysis Results window will
  2081.                    automatically be determined.
  2082.  
  2083.  
  2084.          Timing Concepts
  2085.  
  2086.                    A program is composed of a series of sequential
  2087.                    statements. These statements are executed by the
  2088.                    processor one at a time in a linear fashion, sequencing
  2089.                    through program memory. The length of time it takes to
  2090.                    execute any given series of statements is calculated as
  2091.                    the sum of each instruction's execution time.
  2092.  
  2093.                    The linear processing of statements may be interrupted
  2094.                    by special instructions called branches or jumps. In
  2095.                    the simple case, the linear flow changes to another
  2096.                    address location in program memory and continues its
  2097.                    linear flow.
  2098.  
  2099.                    It is the job of TimeStack to look at every possible
  2100.                    combination of these paths to obtain the results of the
  2101.                    analysis.
  2102.  
  2103.  
  2104.          Conditional Branches
  2105.  
  2106.                    Processors have a special instruction called a
  2107.                    conditional branch that allows them to make a choice
  2108.                    between one of two paths to take. The linear flow
  2109.                    through a conditional branch may continue and FALL
  2110.                    through, or the processor may TAKE the conditional
  2111.                    branch and disrupt the flow. In TimeStack a branch is
  2112.                    NORMAL when both directions are analyzed.
  2113.  
  2114.                    TimeStack looks at the flow of execution from a given
  2115.                    starting address in program memory to a given stop
  2116.                    address in program memory. The analysis determines what
  2117.                    combination of TAKEs and FALLs gives the absolute worst
  2118.                    case theoretical time possible and shows this path. It
  2119.                    also shows the best (or fastest) time and its path. It
  2120.                    also shows the worst case stack depth usage and its
  2121.                    path.
  2122.  
  2123.  
  2124.                  Take
  2125.  
  2126.                    A conditional branch has an address associated with it.
  2127.                    When the branch is taken, program execution continues
  2128.                    at this address.
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.                                         31          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  2135.  
  2136.  
  2137.  
  2138.                    The number of times a branch is taken before it falls
  2139.                    though may be associated with a conditional branch. A
  2140.                    branch may also be forced so that it is always taken.
  2141.  
  2142.  
  2143.                  Fall
  2144.  
  2145.                    If a conditional branch is not taken, it must fall
  2146.                    through. Program execution continues with the
  2147.                    instruction immediately following the conditional
  2148.                    branch when it falls through. The number of times a
  2149.                    branch falls through before it is taken may also be
  2150.                    associated with a conditional branch. A branch may be
  2151.                    forced to always fall through.
  2152.  
  2153.  
  2154.                  Normal
  2155.  
  2156.                    A branch that has no special conditions associated with
  2157.                    it such as take or fall is considered to be normal.
  2158.                    Conditional branches that move backwards might be part
  2159.                    of a loop. To indicate to TimeStack that this is not
  2160.                    the case, they may be set to normal.
  2161.  
  2162.  
  2163.          Program Loops
  2164.  
  2165.                    A loop is only possible if some type of backwards
  2166.                    branching occurs. TimeStack is not a simulator and has
  2167.                    no knowledge of the possible implications of a
  2168.                    backwards branch. If the backwards branch causes some
  2169.                    type of loop to be formed, the user must assist the
  2170.                    TimeStack and give more information about the loop.
  2171.  
  2172.                    The user tells TimeStack how a conditional branch
  2173.                    should operate in special situations. This is done by
  2174.                    indicating how many times a conditional branch should
  2175.                    FALL through before taking a branch or how many times
  2176.                    to TAKE the branch before falling through.
  2177.  
  2178.          !! ->     A conditional branch may be set to TAKE (take the
  2179.                    branch), FALL (fall through the branch), and NORMAL
  2180.                    (try both take and fall paths). In addition, TAKE and
  2181.                    FALL may be set to a number that indicates how many
  2182.                    times to take a branch before falling through or how
  2183.                    many times to fall through before taking the branch.
  2184.  
  2185.                    A conditional branch may be said to TAKE 5 times. This
  2186.                    means TimeStack would not look at the path that falls
  2187.                    through until it has followed the path the branch takes
  2188.                    five times.
  2189.  
  2190.  
  2191.  
  2192.                                         32          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  2193.  
  2194.  
  2195.  
  2196.                    A NORMAL conditional branch is one that branches
  2197.                    backwards yet is not actually a part of a loop.
  2198.  
  2199.                    The conditional branch in Figure 3-2 would be set to
  2200.                    TAKE 26 times. This is one less that the actual number
  2201.                    of times the loop is done because the 27th time through
  2202.                    the loop, the branch is not taken but falls through.
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.                    000001 0006          ;   Loop type 1
  2209.                    000002 0006          ;
  2210.                    000003 0006 861B              LDAA #27
  2211.                    000004 0008 6F00     LOOP1:   CLR   0,X
  2212.                    000005 000A 08                INX
  2213.                    000006 000B 4A                DECA
  2214.                    000007 000C 26FA              BNE  LOOP1
  2215.                    000008 000E 39                RTS
  2216.  
  2217.  
  2218.  
  2219.                    Figure 3-2   Loop with Exit at Bottom
  2220.  
  2221.  
  2222.  
  2223.                    The conditional branch in Figure 3-3 would be set to
  2224.                    FALL 27 times. That is because the increment of the
  2225.                    loop counter is done after the conditional branch test.
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.                    000001 000F          ;   Loop type 2
  2232.                    000002 000F          ;
  2233.                    000003 000F CE0000            LDX  #0
  2234.                    000004 0012 8C001B   LOOP2:   CPX   #27
  2235.                    000005 0015 2705              BEQ  DONE
  2236.                    000006 0017 6F00              CLR  0,X
  2237.                    000007 0019 08                INX
  2238.                    000008 001A 20F6              BRA  LOOP2
  2239.                    000009 001C 39       DONE:    RTS
  2240.  
  2241.  
  2242.  
  2243.                    Figure 3-3   Loop with Exit in the Middle
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.                                         33          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.                    Look at these examples very closely. Understanding how
  2259.                    many times to specify a branch to TAKE or FALL is very
  2260.                    important. This information is entered using the Edit
  2261.                    menu and specifying the address of the conditional
  2262.                    branch.
  2263.  
  2264.  
  2265.          Subroutines
  2266.  
  2267.                    The processor instructions that jump, branch, and jump
  2268.                    subroutine change the execution path. If a jump or
  2269.                    branch is backwards, then there is the possibility of
  2270.                    an infinite loop. In these cases the user is given the
  2271.                    chance to edit the special node information which
  2272.                    usually means setting up a conditional branch to TAKE
  2273.                    or FALL some number of times.
  2274.  
  2275.          Warning   If a jump subroutine is encountered, then it is assumed
  2276.                    that a return from subroutine will be found. The stop
  2277.                    address is ignored during the jump to subroutine. When
  2278.                    a return from subroutine is found, TimeStack returns to
  2279.                    the location immediately following the jump subroutine
  2280.                    even if the return address on the stack was changed.
  2281.  
  2282.                    A maximum cycle time and stack depth may be associated
  2283.                    with any jump subroutine instruction. The values
  2284.                    entered will be used whenever that instruction is
  2285.                    encountered. This allows calls from different locations
  2286.                    in the program to the same subroutine to have different
  2287.                    maximum cycle times and stack depth values.
  2288.  
  2289.                    The value entered for maximum cycle time is also used
  2290.                    for the minimum cycle time. This causes the minimum
  2291.                    cycle time to be flagged (see Windows - Statistics).
  2292.  
  2293.                    Jump subroutine instructions that are indirect must
  2294.                    have the cycle time and stack depth information entered
  2295.                    for them. This is more versatile than entering a
  2296.                    destination address. The analysis will always include
  2297.                    the cycle time and stack depth of the jump subroutine
  2298.                    instruction itself. Thus, a value of zero for both the
  2299.                    cycle time and stack depth will only include the cycle
  2300.                    time and stack depth for the jump subroutine
  2301.                    instruction.
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.                                         34          TimeStack User's Guide    Chapter Three - Understanding TimeStack
  2309.  
  2310.  
  2311.  
  2312.          Jump Indirect
  2313.  
  2314.                    Jump instructions that are indirect may have an address
  2315.                    associated with them. If none has been entered for
  2316.                    them, then a prompt for an address will be given on the
  2317.                    first occurrence of the instruction during analysis.
  2318.  
  2319.                    The option to pretend the instruction is a return
  2320.                    subroutine is also made. This is useful for subroutines
  2321.                    that pull the return address and use it at a later time
  2322.                    as shown in Figure 3-4
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.                    000001 001D          ;   Jump indirect used
  2329.                    000002 001D          ;   as return subroutine
  2330.                    000003 001D          ;
  2331.                    000004 001D          JMPIND:
  2332.                    000005 001D 01                NOP
  2333.                    000006 001E 38                PULX
  2334.                    000007 001F 6E00              JMP  0,X
  2335.  
  2336.  
  2337.  
  2338.                    Figure 3-4   Jump Indirect used as Return from
  2339.                    Subroutine
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.          Stack Depth
  2347.  
  2348.                    When an analysis is done, the current stack depth is
  2349.                    assumed to be zero. As the analysis progresses there
  2350.                    may be instructions that modify the stack by pushing
  2351.                    and pulling data. If any instructions that modify the
  2352.                    stack pointer directly are encountered, the resulting
  2353.                    values from the analysis will not be correct.
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.                                         35          TimeStack User's Guide                    Chapter Four - Tutorial
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.          Chapter Four - Tutorial
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.                    Using TimeStack is usually as simple as specifying the
  2391.                    starting address of a subroutine. It can analyze the
  2392.                    complete control function of a complex algorithm that
  2393.                    takes hundreds of milliseconds to execute as easily as
  2394.                    it handles checking how many microseconds a multiply
  2395.                    function takes to run.
  2396.  
  2397.                    This will be a short look at a typical analysis. The
  2398.                    executable program and files used here are included
  2399.                    with TimeStack. Just start at the beginning here and
  2400.                    work your way through one step at a time.
  2401.  
  2402.  
  2403.          Look at Listing
  2404.  
  2405.                    The first step should be to look over a listing of the
  2406.                    program to get an understanding of what it does. The
  2407.                    program in Appendix A is a nonsense program that only
  2408.                    provides routines for learning about TimeStack. The hex
  2409.                    file that matches this listing is called: DEMO.HEX.
  2410.  
  2411.  
  2412.          Invoking Program
  2413.  
  2414.                    The program is invoked by changing to the TimeStack
  2415.                    directory and typing the name of the program that
  2416.                    corresponds to the processor family desired. To run the
  2417.                    correct program for the demo type:
  2418.  
  2419.                    TSDEMO.
  2420.  
  2421.  
  2422.  
  2423.  
  2424.                                         36          TimeStack User's Guide                    Chapter Four - Tutorial
  2425.  
  2426.  
  2427.  
  2428.          Configuring TimeStack
  2429.  
  2430.                    The first time TimeStack is entered it will be
  2431.                    necessary to configure it. Choose the Options menu by
  2432.                    pressing the letter O from the main menu or the hot key
  2433.                    ALT-O from any place in the program.
  2434.  
  2435.                    The submenu Type allows selection of the specific
  2436.                    processor. Press T to select this item or press Enter
  2437.                    since the highlighted menu bar is already on the item.
  2438.                    In this case there is no choice to make. The demo
  2439.                    program knows only one type of processor, the 68DEMO.
  2440.                    Press 1 to select it specifically, Enter to choose the
  2441.                    currently selected item, or Esc to abort any changes.
  2442.  
  2443.                    The submenu Clock allows entering the clock rate of the
  2444.                    processor that will be used. Use the Cur Dn key to
  2445.                    select this item and press Enter or just press the
  2446.                    letter C as a shortcut. To obtain the same results that
  2447.                    will be shown here be sure the value is set to 1 which
  2448.                    means 1.0 megahertz.
  2449.  
  2450.                    The submenu Get information displays a variety of
  2451.                    information. At the top is the current version of the
  2452.                    TimeStack program. Also shown is the currently selected
  2453.                    processor, clock rate, and clock divisor. The current
  2454.                    working directory and all file names that have been
  2455.                    entered or have default values are given. The amount of
  2456.                    available memory for use in analysis is shown.
  2457.  
  2458.                    It is usually desirable to save any work that has been
  2459.                    done. This may be set up to be done automatically upon
  2460.                    exit. Use the submenu 1. Configuration to have the
  2461.                    configuration automatically saved. Use the submenu 2.
  2462.                    Node list to have the special node list automatically
  2463.                    saved. Enable both of these options by answering Yes at
  2464.                    their prompts.
  2465.  
  2466.  
  2467.          Load the Hex File
  2468.  
  2469.                    Press ALT-L to jump right to the File | Load menu. At
  2470.                    the prompt for the hex data file name, enter DEMO. This
  2471.                    is the name of the demonstration hex file and the
  2472.                    extension .HEX will automatically be added.
  2473.  
  2474.                    Immediately after pressing Enter, a box is displayed in
  2475.                    the center of the screen. It indicates that it is
  2476.                    loading the hex file. The box disappears after the hex
  2477.                    file is loaded.
  2478.  
  2479.  
  2480.  
  2481.  
  2482.                                         37          TimeStack User's Guide                    Chapter Four - Tutorial
  2483.  
  2484.  
  2485.  
  2486.          Timing Subroutines
  2487.  
  2488.                    Press ALT-A to move quickly to the Analysis menu.
  2489.                    Figure 4-1 shows the procedure to be analyzed. For the
  2490.                    start address type in 2A and press Enter. Note that
  2491.                    leading zeros on addresses do not need to be entered.
  2492.  
  2493.                    For the stop address leave the FFFF that is already
  2494.                    there and press Enter again. This tells the TimeStack
  2495.                    to analyze the procedure called SIMPLE that starts at
  2496.                    address 002A and to stop when a return from subroutine
  2497.                    instruction is encountered.
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.                    000021 002A          ;   Simple subroutine
  2504.                    000022 002A          ;
  2505.                    000023 002A          ;   no conditional branches.
  2506.                    000024 002A          ;
  2507.                    000025 002A          ;   11 min  11 max  0 stack
  2508.                    000026 002A          ;
  2509.                    000027 002A          SIMPLE:
  2510.                    000028 002A 40                NEGA
  2511.                    000029 002B 48                ASLA
  2512.                    000030 002C 8B05              ADDA #5
  2513.                    000031 002E 39                RTS
  2514.  
  2515.  
  2516.  
  2517.                    Figure 4-1   Simple Subroutine
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.                    The Analysis Results window will show that this small
  2524.                    procedure took a minimum of 11 CPU internal clock
  2525.                    cycles, a maximum of 11 cycles, and a maximum stack
  2526.                    depth of 0 bytes of stack. Notice that the stack depth
  2527.                    now indicates -2 bytes. This represents the stack
  2528.                    pointer right now after the analysis has finished. It
  2529.                    means nothing was left remaining on the stack. In fact,
  2530.                    two bytes have been pulled off that were not pushed on
  2531.                    during the analysis. This is caused by the return from
  2532.                    subroutine instruction pulling its two bytes of address
  2533.                    information off of the stack.
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.                                         38          TimeStack User's Guide                    Chapter Four - Tutorial
  2541.  
  2542.  
  2543.  
  2544.                    The actual stop address was found for us. The
  2545.                    subroutine ranges from 002A to 002E. Its size was 5
  2546.                    bytes.
  2547.  
  2548.                    Using a 1 Megahertz external clock this subroutine will
  2549.                    execute in an absolute worst case maximum time of 44.0
  2550.                    microseconds. This includes the time from the start of
  2551.                    the first instruction until the return from subroutine
  2552.                    instruction finishes.
  2553.  
  2554.  
  2555.          Timing Subroutines with Conditional Branches
  2556.  
  2557.                    From now on it will be assumed that you are familiar
  2558.                    with how to analyze a procedure from the Analysis menu.
  2559.                    If you are not, review the previous section again. The
  2560.                    stop address for most of the examples will be left at
  2561.                    FFFF.
  2562.  
  2563.                    Now analyze the procedure called FWDBRA. Figure 4-2
  2564.                    contains this procedure. It has a start address of
  2565.                    002F. The results of this analysis have put some
  2566.                    information in the Maximum Execution, Minimum
  2567.                    Execution, and Stack Depth windows. It shows that to
  2568.                    obtain the maximum execution time the conditional
  2569.                    branch at 0030 must FALL through, the branch at 0036
  2570.                    must TAKE, and the last branch at 003E must FALL
  2571.                    through. Only conditional branches are shown because
  2572.                    they are the only opportunity to change program flow.
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.                                         39          TimeStack User's Guide                    Chapter Four - Tutorial
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.                    000032 002F          ;   Forward branches
  2605.                    000033 002F          ;
  2606.                    000034 002F          ;   only forward branches.
  2607.                    000035 002F          ;
  2608.                    000036 002F          ;   16 min  26 max  0 stack
  2609.                    000037 002F          ;
  2610.                    000038 002F          FWDBRA:
  2611.                    000039 002F 47                ASRA
  2612.                    000040 0030 2406              BCC  FWD010
  2613.                    000041 0032 CE002A            LDX  #SIMPLE
  2614.                    000042 0035 47                ASRA
  2615.                    000043 0036 2405              BCC  FWD020
  2616.                    000044 0038          FWD010:
  2617.                    000045 0038 CE002F            LDX  #FWDBRA
  2618.                    000046 003B 2006              BRA  FWDRET
  2619.                    000047 003D          FWD020:
  2620.                    000048 003D 47                ASRA
  2621.                    000049 003E 2403              BCC  FWDRET
  2622.                    000050 0040 CE0044            LDX  #BCKBRA
  2623.                    000051 0043          FWDRET:
  2624.                    000052 0043 39                RTS
  2625.  
  2626.  
  2627.  
  2628.                    Figure 4-2   Forward Branches
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.                    It should be mentioned that the paths shown by
  2635.                    TimeStack only represent one way to achieve the
  2636.                    analysis results. There may be others that are equal
  2637.                    but not shown.
  2638.  
  2639.                    The next procedure is called BCKBRA. This is shown in
  2640.                    Figure 4-3. Begin the analysis by entering its start
  2641.                    address of 0044. Any branch that has a destination
  2642.                    which can move the execution backwards creates the
  2643.                    possibility of forming a loop. The Edit Branch window
  2644.                    is opened on the branch at 0054. The edit window
  2645.                    indicates the branch is CLEAR because it has not had
  2646.                    any attributes set. This branch does not participate in
  2647.                    forming any kind of loop. It merely branches backwards
  2648.                    to a return from subroutine instruction. Of the four
  2649.                    possible choices, choose Normal for this branch.
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.                                         40          TimeStack User's Guide                    Chapter Four - Tutorial
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.                    000053 0044          ;   Backward normal branches
  2663.                    000054 0044          ;
  2664.                    000055 0044          ;   all normal branches.
  2665.                    000056 0044          ;
  2666.                    000057 0044          ;   16 min  26 max  0 stack
  2667.                    000058 0044          ;
  2668.                    000059 0044          BCKBRA:
  2669.                    000060 0044 47                ASRA
  2670.                    000061 0045 2407              BCC  BCK010
  2671.                    000062 0047 CE002A            LDX  #SIMPLE
  2672.                    000063 004A 47                ASRA
  2673.                    000064 004B 2406              BCC  BCK020
  2674.                    000065 004D          BCKRET:
  2675.                    000066 004D 39                RTS
  2676.                    000067 004E          BCK010:
  2677.                    000068 004E CE002F            LDX  #FWDBRA
  2678.                    000069 0051 20FA              BRA  BCKRET
  2679.                    000070 0053          BCK020:
  2680.                    000071 0053 47                ASRA
  2681.                    000072 0054 24F7              BCC  BCKRET
  2682.                    000073 0056 CE0044            LDX  #BCKBRA
  2683.                    000074 0059 39                RTS
  2684.  
  2685.  
  2686.  
  2687.                    Figure 4-3   Backwards Branches that are Normal
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.                    The analysis continues to run but now issues a warning
  2694.                    about a backwards branch at 0051. This branch, since it
  2695.                    also moves backwards, may be forming part of a loop.
  2696.                    Upon inspection it is seen that this is not the case.
  2697.                    Press any key to remove the warning and then respond to
  2698.                    the edit branches now prompt with a No.
  2699.  
  2700.                    The Special Nodes window now displays the conditional
  2701.                    branch that was entered during the analysis.
  2702.  
  2703.  
  2704.          Timing Loops
  2705.  
  2706.  
  2707.                  Simple loop
  2708.  
  2709.                    The procedure SIMPLOOP at address 005A shown in Figure
  2710.                    4-4, forms a simple loop. Begin the analysis of this
  2711.  
  2712.  
  2713.  
  2714.                                         41          TimeStack User's Guide                    Chapter Four - Tutorial
  2715.  
  2716.  
  2717.  
  2718.                    procedure. The conditional branch at 005E will be
  2719.                    pulled up during the analysis. In order to determine
  2720.                    what should be entered it will be necessary to look at
  2721.                    the program logic. In this case, it looks as if the
  2722.                    code inside the loop should be executed five times. To
  2723.                    achieve this the conditional branch will be taken four
  2724.                    times. The fifth time through the loop the branch falls
  2725.                    through. At the prompt for the branch choose Take. At
  2726.                    the prompt for the number of times enter 4.
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.                    000075 005A          ;   Simple loop
  2733.                    000076 005A          ;
  2734.                    000077 005A          ;   A simple loop.
  2735.                    000078 005A          ;
  2736.                    000079 005A          ;   42 min  42 max  0 stack
  2737.                    000080 005A          ;
  2738.                    000081 005A          SIMPLOOP:
  2739.                    000082 005A 8605              LDAA #5
  2740.                    000083 005C          SIMP010:
  2741.                    000084 005C 01                NOP
  2742.                    000085 005D 4A                DECA
  2743.                    000086 005E 26FC              BNE  SIMP010
  2744.                    000087 0060 39                RTS
  2745.  
  2746.  
  2747.  
  2748.                    Figure 4-4   Loop with Exit at Bottom
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.                    When the analysis is complete press ALT-4. This selects
  2755.                    the Maximum Execution Window (window number four). Use
  2756.                    the Cur Up and Cur Dn keys to look at all of the
  2757.                    entries. Follow the loop through and see how it works.
  2758.                    Understanding this is very important when configuring a
  2759.                    loop.
  2760.  
  2761.  
  2762.                  Loop with middle exit
  2763.  
  2764.                    The procedure BACKLOOP at address 0061 shown in Figure
  2765.                    4-5 is another common type of loop. It has its exit
  2766.                    near the top or middle. Begin the analysis. TimeStack
  2767.                    will warn that the branch at address 0067 is backwards
  2768.                    and ask if you want to edit branches at this time.
  2769.  
  2770.  
  2771.  
  2772.                                         42          TimeStack User's Guide                    Chapter Four - Tutorial
  2773.  
  2774.  
  2775.  
  2776.                    Answer with a Yes. It is necessary to inspect the
  2777.                    program to determine which conditional branch must be
  2778.                    configured to exit the loop. The branch at address 0064
  2779.                    is the correct one for this example. It must be set to
  2780.                    Fall through five times. Understanding this type of
  2781.                    loop is also very important.
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.                    000088 0061          ;   Loop with backwards branch
  2788.                    000089 0061          ;
  2789.                    000092 0061          ;
  2790.                    000093 0061          ;   62 min  62 max  0 stack
  2791.                    000094 0061          ;
  2792.                    000095 0061          BACKLOOP:
  2793.                    000096 0061 8606              LDAA #6
  2794.                    000097 0063          BACK010:
  2795.                    000098 0063 4A                DECA
  2796.                    000099 0064 2703              BEQ  BACKRET
  2797.                    000100 0066 01                NOP
  2798.                    000101 0067 20FA              BRA  BACK010
  2799.                    000102 0069          BACKRET:
  2800.                    000103 0069 39                RTS
  2801.  
  2802.  
  2803.  
  2804.                    Figure 4-5   Loop with Middle Exit
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.          Printing the Results
  2812.  
  2813.                    The results of this analysis may be sent to a printer.
  2814.                    Be sure the printer is turned on, loaded with paper,
  2815.                    and on-line. The output is sent to the DOS print device
  2816.                    PRN.
  2817.  
  2818.                    Press ALT-P to select the Print menu and then press 3.
  2819.                    Path to Printer. A message will appear the says to
  2820.                    prepare the printer. When the printer is ready, press
  2821.                    Enter. The printing will then begin immediately. A
  2822.                    message is displayed that indicates printing is in
  2823.                    progress. Esc may be pressed during this time to abort.
  2824.  
  2825.                    If there is a problem communicating with the printer, a
  2826.                    message will be displayed indicating what is wrong.
  2827.  
  2828.  
  2829.  
  2830.                                         43          TimeStack User's Guide                    Chapter Four - Tutorial
  2831.  
  2832.  
  2833.  
  2834.                    After corrective action is taken press Enter to
  2835.                    continue. Esc may be pressed to abandon the print.
  2836.  
  2837.  
  2838.          Quitting the Program
  2839.  
  2840.                    Now quit the program by pressing ALT-Q. TimeStack will
  2841.                    attempt to save the special node list but since a node
  2842.                    list file name has not been entered yet it will as if
  2843.                    you wish to save your changes. Answer Yes to this
  2844.                    question and enter whatever name you wish to give the
  2845.                    node list. If you do not enter an extension, .NOD will
  2846.                    automatically be added.
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.                                         44          TimeStack User's Guide           Chapter Five - Timing Strategies
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.          Chapter Five - Timing Strategies
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.          Have a Listing Ready
  2914.  
  2915.                    It is very impractical to use TimeStack without a
  2916.                    current listing of the program to be worked on. It is
  2917.                    possible to use the Disassemble feature to assist but
  2918.                    this is still difficult. A listing provides all of the
  2919.                    addresses that will need to be entered as start
  2920.                    addresses and when editing conditional branches. It
  2921.                    will be needed to determine how many times to take
  2922.                    loops and destination of indirect jumps.
  2923.  
  2924.  
  2925.          What Units to Use
  2926.  
  2927.                    All timing information is given in cycles. This refers
  2928.                    to the processor's internal cycles as defined by the
  2929.                    manufacturer of the device. For convenience, this
  2930.                    number is calculated to microseconds based on the given
  2931.                    external clock rate divided by the clock divisor value.
  2932.  
  2933.                    All memory usage is defined in bytes. A byte is eight
  2934.                    bits of information and is a fundamental unit to all
  2935.                    processors handled by TimeStack. All stack usage is
  2936.                    measured in bytes.
  2937.  
  2938.  
  2939.          Start Small
  2940.  
  2941.                    It is usually best to start with the smaller
  2942.                    subroutines that may be called from throughout the
  2943.  
  2944.  
  2945.  
  2946.                                         45          TimeStack User's Guide           Chapter Five - Timing Strategies
  2947.  
  2948.  
  2949.  
  2950.                    program. This way, many of the loops will be discovered
  2951.                    early without having to search through the listing.
  2952.  
  2953.                    Look at the different paths (maximum cycles, minimum
  2954.                    cycles, and worst case stack depth) and follow them
  2955.                    through the listing a couple of times to develop a feel
  2956.                    for the program. Compare the results on subroutines
  2957.                    that have been timed and documented before.
  2958.  
  2959.  
  2960.          Be Realistic
  2961.  
  2962.                    The worst case path may not be realistic and you may
  2963.                    desire to force a few branches to avoid this. This
  2964.                    usually happens when the logic gets divided into
  2965.                    multiple parts or spread out. It also happens when the
  2966.                    same condition is checked numerous times throughout the
  2967.                    program.
  2968.  
  2969.                    Figure 5-1 is a simple example of this. In the first
  2970.                    part of the logic the NOP instruction will be executed
  2971.                    if register A is not equal to zero. In the second part
  2972.                    of the logic the NOP instruction will be executed if
  2973.                    accumulator A is equal to zero. Obviously both NOPs
  2974.                    could not be executed during the same pass through the
  2975.                    procedure. TimeStack does not detect this and the
  2976.                    maximum execution time will include the time for both
  2977.                    NOPs. In the same way, the minimum execution time will
  2978.                    not time either NOP.
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.                    000001 0000          ;   Unrealistic worst case path
  2985.                    000002 0000          ;
  2986.                    000003 0000          UNREAL:
  2987.                    000004 0000 8100              CMPA #0
  2988.                    000005 0002 2701              BEQ  SKIP1
  2989.                    000006 0004 01                NOP
  2990.                    000007 0005          SKIP1:
  2991.                    000008 0005 8100              CMPA #0
  2992.                    000009 0007 2600              BNE  SKIP2
  2993.                    000010 0009 01                NOP
  2994.                    000011 000A          SKIP2:
  2995.                    000012 000A 39                RTS
  2996.  
  2997.  
  2998.  
  2999.                    Figure 5-1   Unrealistic Worst Case Path
  3000.  
  3001.  
  3002.  
  3003.  
  3004.                                         46          TimeStack User's Guide           Chapter Five - Timing Strategies
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.                    It helps if this type of logic is located in a
  3013.                    subroutine. By forcing one of the branches to always be
  3014.                    taken, the realistic maximum execution time will be
  3015.                    found. Then if this procedure is subsequently called
  3016.                    from another procedure the expected results will be
  3017.                    found.
  3018.  
  3019.  
  3020.          More Than One Path
  3021.  
  3022.                    It is possible that there is more than just the single
  3023.                    path shown by TimeStack that meets the maximum and
  3024.                    minimum execution time and maximum stack depth. Figure
  3025.                    5-2 is a simple example of a procedure that has
  3026.                    identical execution times no matter which path is
  3027.                    taken.
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.                    000013 000B          ;   Identical Paths
  3034.                    000014 000B          ;
  3035.                    000015 000B          IDENT:
  3036.                    000016 000B 8100              CMPA #0
  3037.                    000017 000D 2702              BEQ  IDENT1
  3038.                    000018 000F 01                NOP
  3039.                    000019 0010 39                RTS
  3040.                    000020 0011          IDENT1:
  3041.                    000021 0011 01                NOP
  3042.                    000022 0012 39                RTS
  3043.  
  3044.  
  3045.  
  3046.                    Figure 5-2   Identical Worst Case Paths
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.                    As it turns out, in most cases this is not usually a
  3055.                    problem. If you attempt to optimize the given maximum
  3056.                    execution path and make changes to it, future analysis
  3057.                    will find the new resulting maximum execution paths.
  3058.  
  3059.  
  3060.  
  3061.  
  3062.                                         47          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.          Chapter Six - Advanced Tutorial
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.                    There are many more subtle points that need to brought
  3087.                    out to use the full capabilities of TimeStack and
  3088.                    obtain accurate results.
  3089.  
  3090.                    The complete program for all of the procedures here can
  3091.                    be found in Appendix A.
  3092.  
  3093.  
  3094.          Invoke Program Again
  3095.  
  3096.                    Invoke the TimeStack demo program again. If you have
  3097.                    not already run the program at least once, see the
  3098.                    Chapter Four tutorial. Briefly this involves changing
  3099.                    to the TimeStack directory and typing in the demo
  3100.                    program name: TSDEMO.
  3101.  
  3102.                    If the demo hex file was not automatically loaded,
  3103.                    return to Chapter Four and review Invoking Program,
  3104.                    Configuring TimeStack, and Load the Hex File.
  3105.  
  3106.  
  3107.          Complex Loops
  3108.  
  3109.                    A complex loop is one that TimeStack was not able to
  3110.                    correctly analyze. This occurs because the conditional
  3111.                    branch that was setup as the exit for the loop was not
  3112.                    the conditional branch that really is the exit for the
  3113.                    maximum execution path.
  3114.  
  3115.                    Analyze the procedure COMPLEX at address 006A shown in
  3116.                    Figure 6-1. The conditional branch at 0070 is brought
  3117.  
  3118.  
  3119.  
  3120.                                         48          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3121.  
  3122.  
  3123.  
  3124.                    up in the edit window because it is a backwards branch
  3125.                    and therefore may participate in a loop. Looking at the
  3126.                    algorithm it can be determined that this branch should
  3127.                    be set to TAKE 2.
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.                    000104 006A          ;   Complex loop
  3134.                    000105 006A          ;
  3135.                    000106 006A          ;   A loop that will trigger the
  3136.                    000107 006A          ;   complex loop message.
  3137.                    000108 006A          ;
  3138.                    000109 006A          ;   43 min  43 max  2 stack
  3139.                    000110 006A          ;
  3140.                    000111 006A          COMPLEX:
  3141.                    000112 006A 8605              LDAA #5
  3142.                    000113 006C          COMPL1:
  3143.                    000114 006C 4A                DECA
  3144.                    000115 006D 2704              BEQ  COMPX1
  3145.                    000116 006F 4A                DECA
  3146.                    000117 0070 26FA              BNE  COMPL1
  3147.                    000118 0072 39                RTS
  3148.                    000119 0073          COMPX1:
  3149.                    000120 0073 BD0076            JSR  COMPX2
  3150.                    000121 0076          COMPX2:
  3151.                    000122 0076 39                RTS
  3152.  
  3153.  
  3154.  
  3155.                    Figure 6-1   Complex Loop
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.                    During the analysis an error message is displayed. It
  3162.                    says that the branch at address 006D is involved in a
  3163.                    structure too difficult for a simple analysis.
  3164.  
  3165.                    Upon closer inspection of the branch at 006D and the
  3166.                    algorithm, it can be seen that the conditional branch
  3167.                    at 006D is the true exit for the loop. Press ALT-E to
  3168.                    pull up the Edit window, enter the address 006D, and
  3169.                    set it to FALL 2. Now when the analysis is run, it
  3170.                    completes with the correct answer.
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.                                         49          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3179.  
  3180.  
  3181.  
  3182.          Indirect Jump
  3183.  
  3184.                    Indirect jumps are handled in a simple manner. They may
  3185.                    either be forced to act just like a return from
  3186.                    subroutine or you may enter an address to jump to.
  3187.  
  3188.                    Analyze the procedure INDJMP at address 0077 shown in
  3189.                    Figure 6-2. A message appears that says the indirect
  3190.                    jump at address 0077 needs a destination. After you
  3191.                    press Enter, you are asked if you would like to treat
  3192.                    the indirect jump like a return from subroutine. In
  3193.                    this example respond with No. A prompt for the
  3194.                    destination of the indirect jump is given. Use the
  3195.                    address 007A as the destination.
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.                    000123 0077          ;   Indirect jump test
  3202.                    000124 0077          ;
  3203.                    000125 0077          ;   Indirect jump that goes some
  3204.                    000126 0077          ;   place and one that returns.
  3205.                    000127 0077          ;
  3206.                    000128 0077          ;   11 min  11 max  0 stack
  3207.                    000129 0077          ;
  3208.                    000130 0077          INDJMP:
  3209.                    000131 0077 6E00              JMP  0,X
  3210.                    000132 0079 01                NOP
  3211.                    000133 007A          JMPRET:
  3212.                    000134 007A 38                PULX
  3213.                    000135 007B 6E00              JMP  0,X
  3214.  
  3215.  
  3216.  
  3217.                    Figure 6-2   Indirect Jump
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.                    Now the analysis stops at the indirect jump at 007B.
  3224.                    Respond with Yes when it asks if it should be treated
  3225.                    as a return from subroutine. The reason for this is the
  3226.                    algorithm in this example pulls the return address from
  3227.                    the stack and then uses the indirect jump to jump to
  3228.                    that return address at the end of the procedure. This
  3229.                    is exactly what a return from subroutine does and is a
  3230.                    special way that indirect jumps are used in programs
  3231.                    from time to time.
  3232.  
  3233.  
  3234.  
  3235.  
  3236.                                         50          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3237.  
  3238.  
  3239.  
  3240.          Untimeable Instructions
  3241.  
  3242.                    Some instructions do not make sense to time. Start the
  3243.                    analysis of INSTIME at address 007D shown in Figure 6-
  3244.                    3. The analysis will stop with an error stating that
  3245.                    the opcode at 007F is not able to be analyzed for time.
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.                    000136 007D          ;   Instruction not timeable
  3252.                    000137 007D          ;
  3253.                    000138 007D          ;   This can not be timed.
  3254.                    000139 007D          ;
  3255.                    000140 007D          ;   8 min  8 max  0 stack
  3256.                    000141 007D          ;
  3257.                    000142 007D          INSTIME:
  3258.                    000143 007D 2701              BEQ  INST010
  3259.                    000144 007F CF                STOP
  3260.                    000145 0080          INST010:
  3261.                    000146 0080 39                RTS
  3262.  
  3263.  
  3264.  
  3265.                    Figure 6-3   Instructions that can not be timed
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.                    This particular instruction, the STOP instruction,
  3274.                    causes the processor to stop executing code. It does
  3275.                    not make sense to time it.
  3276.  
  3277.  
  3278.          Illegal Instructions
  3279.  
  3280.                    An opcode that is not recognized by the processor
  3281.                    causes an error message to be displayed. If an analysis
  3282.                    of procedure ILLEGAL at 0081 shown in Figure 6-4 is
  3283.                    done, the error message will complain of an illegal
  3284.                    opcode at address 0083.
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.                                         51          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.                    000147 0081          ;   Illegal instructions
  3301.                    000148 0081          ;
  3302.                    000149 0081          ;   These are illegal in demo.
  3303.                    000150 0081          ;
  3304.                    000151 0081          ;   8 min  8 max  0 stack
  3305.                    000152 0081          ;
  3306.                    000153 0081          ILLEGAL:
  3307.                    000154 0081 2701              BEQ  ILL010
  3308.                    000155 0083 3D                MUL
  3309.                    000156 0084          ILL010:
  3310.                    000157 0084 39                RTS
  3311.  
  3312.  
  3313.  
  3314.                    Figure 6-4   Illegal Instructions
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.                    If this is seen it is probably one of these problems:
  3321.  
  3322.                    * The wrong hex file has been loaded. The hex file
  3323.                      does not match the processor that this version of
  3324.                      TimeStack handles.
  3325.  
  3326.                    * The wrong processor has been chosen. Use the Options
  3327.                      menu to verify that the correct processor is being
  3328.                      used.
  3329.  
  3330.                    * The wrong start address was entered. If the start
  3331.                      address is not the beginning of an instruction it is
  3332.                      difficult to predict how it will be disassembled.
  3333.  
  3334.  
  3335.          Nested Loops
  3336.  
  3337.                    There are a couple of ways that loops may become
  3338.                    nested. Nested loops have special considerations that
  3339.                    must be taken into account.
  3340.  
  3341.  
  3342.                  Loops inside subroutines
  3343.  
  3344.                    Look at Figure 6-5 which shows the procedure OUTLOOP at
  3345.                    address 0085. This procedure contains a loop that calls
  3346.                    another procedure INLOOP using a jump subroutine.
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.                                         52          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.                    000158 0085          ;   Outer loop
  3359.                    000159 0085          ;
  3360.                    000160 0085          ;   Outer loop of nested loops.
  3361.                    000161 0085          ;
  3362.                    000162 0085          ;   482 min  482 max  3 stack
  3363.                    000163 0085          ;
  3364.                    000164 0085          OUTLOOP:
  3365.                    000165 0085 8605              LDAA #5
  3366.                    000166 0087          OUT010:
  3367.                    000167 0087 36                PSHA
  3368.                    000168 0088 BD0090            JSR  INLOOP
  3369.                    000169 008B 32                PULA
  3370.                    000170 008C 4A                DECA
  3371.                    000171 008D 26F8              BNE  OUT010
  3372.                    000172 008F 39                RTS
  3373.  
  3374.  
  3375.  
  3376.                    Figure 6-5   Loop with a call to a Procedure
  3377.  
  3378.  
  3379.  
  3380.                    The procedure INLOOP shown in Figure 6-6 also contains
  3381.                    a loop. Because this loop is located inside a procedure
  3382.                    that is called using a jump subroutine, no special
  3383.                    considerations are needed.
  3384.  
  3385.  
  3386.  
  3387.  
  3388.  
  3389.                    000173 0090          ;   Inner loop
  3390.                    000174 0090          ;
  3391.                    000175 0090          ;   Inner loop of nested loops.
  3392.                    000176 0090          ;
  3393.                    000177 0090          ;   77 min  77 max  0 stack
  3394.                    000178 0090          ;
  3395.                    000179 0090          INLOOP:
  3396.                    000180 0090 860A              LDAA #10
  3397.                    000181 0092          IN010:
  3398.                    000182 0092 01                NOP
  3399.                    000183 0093 4A                DECA
  3400.                    000184 0094 26FC              BNE  IN010
  3401.                    000185 0096 39                RTS
  3402.  
  3403.  
  3404.  
  3405.                    Figure 6-6   Procedure that contains a Loop
  3406.  
  3407.  
  3408.  
  3409.  
  3410.                                         53          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.                    Now analyze OUTLOOP starting at address 0085. The first
  3419.                    branch that will be questioned is the one at 0094 in
  3420.                    INLOOP. This is because it happens to be the first
  3421.                    backwards branch encountered when the analysis took the
  3422.                    jump subroutine. Upon inspection of the algorithm this
  3423.                    branch should be set to Take nine times. The next
  3424.                    backwards branch questioned is the one at 008D. This
  3425.                    should be set to Take four times according to its
  3426.                    algorithm.
  3427.  
  3428.  
  3429.                  Loops inside other loops
  3430.  
  3431.                    A loop that is inside of another loop does have special
  3432.                    considerations. The procedure TWOLOOP at address 0097
  3433.                    as shown in Figure 6-7 is an example of this. There is
  3434.                    an outer loop that is done five times. There is an
  3435.                    inner loop that is done ten times every time the outer
  3436.                    loop is done. Thus, the inner loop is done a total of
  3437.                    50 times.
  3438.  
  3439.  
  3440.  
  3441.                    000186 0097          ;   Two loops
  3442.                    000187 0097          ;
  3443.                    000188 0097          ;   Two loops in one.
  3444.                    000189 0097          ;
  3445.                    000190 0097          ;   436 min  436 max  0 stack
  3446.                    000191 0097          ;
  3447.                    000192 0097          TWOLOOP:
  3448.                    000193 0097 CE0005            LDX  #5
  3449.                    000194 009A          TWO010:
  3450.                    000195 009A 01                NOP
  3451.                    000196 009B 860A              LDAA #10
  3452.                    000197 009D          TWO020:
  3453.                    000198 009D 01                NOP
  3454.                    000199 009E 4A                DECA
  3455.                    000200 009F 26FC              BNE  TWO020
  3456.                    000201 00A1          ;
  3457.                    000202 00A1 09                DEX
  3458.                    000203 00A2 26F6              BNE  TWO010
  3459.                    000204 00A4          ;
  3460.                    000205 00A4 39                RTS
  3461.  
  3462.  
  3463.  
  3464.                    Figure 6-7   Nested Loops
  3465.  
  3466.  
  3467.  
  3468.                                         54          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.                    Edit the branch at 009F to Take 49 times and the branch
  3477.                    at 00A2 to Take four times to get the correct results
  3478.                    for this procedure.
  3479.  
  3480.  
  3481.          Subroutines with Different Execution Times
  3482.  
  3483.                    Some subroutines have different execution times based
  3484.                    on parameters they are called with. Look at Figure 6-8.
  3485.                    The procedure VARLOOP at address 00A5 calls DIFSUB at
  3486.                    address 00B4 with a parameter that changes its
  3487.                    execution time. The proper way to analyze this
  3488.                    situation is to look at the different trial runs and
  3489.                    program each jump subroutine with the results.
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.                    000206 00A5          ;   Variable loops
  3496.                    000207 00A5          ;
  3497.                    000208 00A5          ;   Different loop times
  3498.                    000209 00A5          ;
  3499.                    000210 00A5          ;   211 min  211 max  2 stack
  3500.                    000211 00A5          ;
  3501.                    000212 00A5          VARLOOP:
  3502.                    000213 00A5 8605              LDAA #5
  3503.                    000214 00A7 BD00B4            JSR  DIFSUB
  3504.                    000215 00AA 860A              LDAA #10
  3505.                    000216 00AC BD00B4            JSR  DIFSUB
  3506.                    000217 00AF 8614              LDAA #20
  3507.                    000218 00B1 7E00B4            JMP  DIFSUB
  3508.                    000219 00B4          ;
  3509.                    000220 00B4          DIFSUB:
  3510.                    000221 00B4 4A                DECA
  3511.                    000222 00B5 26FD              BNE  DIFSUB
  3512.                    000223 00B7 39                RTS
  3513.  
  3514.  
  3515.  
  3516.                    Figure 6-8   Subroutines with Different Execution Times
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.                                         55          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3527.  
  3528.  
  3529.  
  3530.                    The first time DIFSUB is called it loops five times.
  3531.                    Edit the conditional branch at 00B5 to Take four times.
  3532.                    Now analyze the procedure DIFSUB at address 00B4. You
  3533.                    should get the 30 cycles for the maximum execution time
  3534.                    and zero bytes for the maximum stack depth. Edit the
  3535.                    jump subroutine at address 00A7. Enter the values just
  3536.                    obtained at the prompts for maximum cycle time and
  3537.                    maximum stack depth.
  3538.  
  3539.                    The second time DIFSUB is called it loops ten times.
  3540.                    Edit the conditional branch at 00B5 to Take nine times
  3541.                    and run the analysis on it again. This time you should
  3542.                    get 55 cycles for the maximum execution time and still
  3543.                    zero bytes for maximum stack depth. Edit the jump
  3544.                    subroutine at address 00AC and enter these values.
  3545.  
  3546.                    The last time DIFSUB is called it loops twenty times.
  3547.                    Edit the conditional branch at 00B5 to Take nineteen
  3548.                    times. Now you can analyze VARLOOP at 00A5 to get its
  3549.                    correct worst case results which should be 211 cycles.
  3550.  
  3551.  
  3552.          Stack Imbalance
  3553.  
  3554.                    Analyze the procedure STKIMB at address 00B8 and shown
  3555.                    in Figure 6-9. A warning is displayed that says a
  3556.                    mismatch of the stack occurred following the
  3557.                    conditional branch at address 00B9. It says that stack
  3558.                    depth when the branch is taken is -2 bytes deep and
  3559.                    when the branch falls through it is only -1 bytes deep.
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.                    000224 00B8          ;   Stack Imbalance
  3566.                    000225 00B8          ;
  3567.                    000226 00B8          ;   Stack may become imbalanced
  3568.                    000227 00B8          ;
  3569.                    000228 00B8          ;   10 min  13 max  1 stack
  3570.                    000229 00B8          ;
  3571.                    000230 00B8          STKIMB:
  3572.                    000231 00B8 01                NOP
  3573.                    000232 00B9 2601              BNE  STK010
  3574.                    000233 00BB 36                PSHA
  3575.                    000234 00BC          STK010:
  3576.                    000235 00BC 39                RTS
  3577.  
  3578.  
  3579.  
  3580.                    Figure 6-9   Stack Imbalance
  3581.  
  3582.  
  3583.  
  3584.                                         56          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.                    A close look at the algorithm shows what has happened.
  3593.                    One path of the conditional branch at 00B9 will push a
  3594.                    register while the other path does not. This creates
  3595.                    the possibility of a stack imbalance.
  3596.  
  3597.  
  3598.          Infinite Loops
  3599.  
  3600.                    Infinite loops in the program will eventually cause the
  3601.                    analysis to reach an internal limitation and stop. Look
  3602.                    at Figure 6-10. The procedure SIMPLOOP at address 005A
  3603.                    has a conditional branch at 005E that forms a loop.
  3604.                    Edit this branch and set it to Take always. This is
  3605.                    done by setting the number of times to take the branch
  3606.                    to zero.
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.                    000075 005A          ;   Simple loop
  3613.                    000076 005A          ;
  3614.                    000077 005A          ;   A simple loop.
  3615.                    000078 005A          ;
  3616.                    000079 005A          ;   42 min  42 max  0 stack
  3617.                    000080 005A          ;
  3618.                    000081 005A          SIMPLOOP:
  3619.                    000082 005A 8605              LDAA #5
  3620.                    000083 005C          SIMP010:
  3621.                    000084 005C 01                NOP
  3622.                    000085 005D 4A                DECA
  3623.                    000086 005E 26FC              BNE  SIMP010
  3624.                    000087 0060 39                RTS
  3625.  
  3626.  
  3627.  
  3628.                    Figure 6-10   Simple Loop
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.                    Now do an analysis on this procedure. The analysis runs
  3635.                    until an internal TimeStack limitation is reached. This
  3636.                    is usually stack depth but it could be memory. Every
  3637.                    time a conditional branch or jump subroutine is
  3638.                    encountered in the analysis a little bit of internal
  3639.  
  3640.  
  3641.  
  3642.                                         57          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3643.  
  3644.  
  3645.  
  3646.                    memory and stack depth is used by TimeStack. If the
  3647.                    analysis encounters a loop that runs for a long time
  3648.                    this internal limitation of TimeStack may eventually be
  3649.                    reached.
  3650.  
  3651.  
  3652.                  Memory limitations
  3653.  
  3654.                    If a memory limitation is reached, it is up to the user
  3655.                    to determine if or how the program entered into a large
  3656.                    or infinite loop. In general, it is not a good idea to
  3657.                    try and time loops that run for more than a couple of
  3658.                    hundred iterations. Also, it may be that one of the
  3659.                    conditional branches has not been programmed or
  3660.                    programmed incorrectly. It may be possible to narrow
  3661.                    down the area that is the problem by changing the start
  3662.                    and stop addresses if a large procedure is being
  3663.                    analyzed.
  3664.  
  3665.                    A solution to timing loops that run for a large number
  3666.                    of times is to time the loop when it is taken only
  3667.                    once. Then time the loop when it is taken twice.
  3668.                    Calculate the difference between these results and you
  3669.                    have how long each time through the loop will take.
  3670.                    Multiply this value by number of iterations minus one
  3671.                    through the loop and add it to the time it took for
  3672.                    once through the loop. It may even be beneficial to
  3673.                    document how many cycles each iteration of the loop
  3674.                    takes.
  3675.  
  3676.  
  3677.          Branch Past Stop Address
  3678.  
  3679.                    Analyze the procedure FWDBRA at address 002F shown in
  3680.                    Figure 6-11. Use a start address of 002F and a stop
  3681.                    address of 003B.
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.                                         58          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.                    000032 002F          ;   Forward branches
  3707.                    000033 002F          ;
  3708.                    000034 002F          ;   only forward branches.
  3709.                    000035 002F          ;
  3710.                    000036 002F          ;   16 min  26 max  0 stack
  3711.                    000037 002F          ;
  3712.                    000038 002F          FWDBRA:
  3713.                    000039 002F 47                ASRA
  3714.                    000040 0030 2406              BCC  FWD010
  3715.                    000041 0032 CE002A            LDX  #SIMPLE
  3716.                    000042 0035 47                ASRA
  3717.                    000043 0036 2405              BCC  FWD020
  3718.                    000044 0038          FWD010:
  3719.                    000045 0038 CE002F            LDX  #FWDBRA
  3720.                    000046 003B 2006              BRA  FWDRET
  3721.                    000047 003D          FWD020:
  3722.                    000048 003D 47                ASRA
  3723.                    000049 003E 2403              BCC  FWDRET
  3724.                    000050 0040 CE0044            LDX  #BCKBRA
  3725.                    000051 0043          FWDRET:
  3726.                    000052 0043 39                RTS
  3727.  
  3728.  
  3729.  
  3730.                    Figure 6-11   Forward Branches
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.                    A warning message indicates that the branch at address
  3737.                    0036 was past the stop address. When this condition
  3738.                    occurs in an analysis only the first violation is
  3739.                    shown. TimeStack does not look at any portion of the
  3740.                    program that is past the stop address. In this example
  3741.                    the take path of the conditional branch at 0036 is
  3742.                    ignored.
  3743.  
  3744.  
  3745.          Actual Stop Address
  3746.  
  3747.                    Still referring to Figure 6-11, do an analysis from
  3748.                    002F to a stop address of 1234. A warning is displayed
  3749.                    that indicates the specified stop address was never
  3750.                    reached. It says the true stop address is 0043.
  3751.  
  3752.                    TimeStack figures out what the greatest execution
  3753.                    address obtained is. This does not include jump to
  3754.                    subroutines. If the stop address was not FFFF and the
  3755.  
  3756.  
  3757.  
  3758.                                         59          TimeStack User's Guide            Chapter Six - Advanced Tutorial
  3759.  
  3760.  
  3761.  
  3762.                    stop address entered is greater than what TimeStack
  3763.                    thinks it should have been, this warning is displayed.
  3764.  
  3765.  
  3766.          Forcing Conditional Branches
  3767.  
  3768.                    Forcing branches to take different paths to analyze
  3769.                    unique scenarios may be done quickly with the use of
  3770.                    F2. Use the cursor keys to move the branch to be
  3771.                    modified to the top of the Special Nodes window and
  3772.                    press F2. This may also be done inside the Disassembly
  3773.                    window.
  3774.  
  3775.  
  3776.          Save to File
  3777.  
  3778.                    It is convenient to save the analysis for printing
  3779.                    using the Print menu. It is helpful to have the disk
  3780.                    file name match the name of the subroutine or module
  3781.                    that was analyzed.
  3782.  
  3783.  
  3784.          High Level Languages
  3785.  
  3786.                    It is possible to use TimeStack with a high level
  3787.                    language. A listing of the compiled output from the
  3788.                    high level language compiler with the generated
  3789.                    assembly statements is needed. The listing is used to
  3790.                    find the start and stop addresses of procedures and to
  3791.                    figure out where the conditional branches are. Some
  3792.                    knowledge of how the compiler creates loop structures
  3793.                    is desirable.
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.                                         60          TimeStack User's Guide       Appendix A - Listing of Demo Program
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.          Appendix A - Listing of Demo Program
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.          000001 0000          ;   Main program
  3841.          000002 0000          ;
  3842.          000003 0000          ;   1424 min  1444 max  5 stack
  3843.          000004 0000          ;
  3844.          000005 0000          MAIN:
  3845.          000006 0000 BD002A            JSR  SIMPLE
  3846.          000007 0003 BD002F            JSR  FWDBRA
  3847.          000008 0006 BD0044            JSR  BCKBRA
  3848.          000009 0009 BD005A            JSR  SIMPLOOP
  3849.          000010 000C BD0061            JSR  BACKLOOP
  3850.          000011 000F BD006A            JSR  COMPLEX
  3851.          000012 0012 BD0077            JSR  INDJMP
  3852.          000013 0015 BD007D            JSR  INSTIME
  3853.          000014 0018 BD0081            JSR  ILLEGAL
  3854.          000015 001B BD0085            JSR  OUTLOOP
  3855.          000016 001E BD0097            JSR  TWOLOOP
  3856.          000017 0021 BD00A5            JSR  VARLOOP
  3857.          000018 0024 CE002A            LDX  #SIMPLE
  3858.          000019 0027 AD00              JSR  0,X  ; Uses 0 cycles 0 stack
  3859.          000020 0029 39                RTS
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.                                         61          TimeStack User's Guide       Appendix A - Listing of Demo Program
  3875.  
  3876.  
  3877.  
  3878.          000021 002A          ;   Simple subroutine
  3879.          000022 002A          ;
  3880.          000023 002A          ;   Contains no conditional branches.
  3881.          000024 002A          ;
  3882.          000025 002A          ;   11 min  11 max  0 stack
  3883.          000026 002A          ;
  3884.          000027 002A          SIMPLE:
  3885.          000028 002A 40                NEGA
  3886.          000029 002B 48                ASLA
  3887.          000030 002C 8B05              ADDA #5
  3888.          000031 002E 39                RTS
  3889.  
  3890.  
  3891.  
  3892.          000032 002F          ;   Forward branches
  3893.          000033 002F          ;
  3894.          000034 002F          ;   Contains only forward branches.
  3895.          000035 002F          ;
  3896.          000036 002F          ;   16 min  26 max  0 stack
  3897.          000037 002F          ;
  3898.          000038 002F          FWDBRA:
  3899.          000039 002F 47                ASRA
  3900.          000040 0030 2406              BCC  FWD010
  3901.          000041 0032 CE002A            LDX  #SIMPLE
  3902.          000042 0035 47                ASRA
  3903.          000043 0036 2405              BCC  FWD020
  3904.          000044 0038          FWD010:
  3905.          000045 0038 CE002F            LDX  #FWDBRA
  3906.          000046 003B 2006              BRA  FWDRET
  3907.          000047 003D          FWD020:
  3908.          000048 003D 47                ASRA
  3909.          000049 003E 2403              BCC  FWDRET
  3910.          000050 0040 CE0044            LDX  #BCKBRA
  3911.          000051 0043          FWDRET:
  3912.          000052 0043 39                RTS
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.                                         62          TimeStack User's Guide       Appendix A - Listing of Demo Program
  3933.  
  3934.  
  3935.  
  3936.          000053 0044          ;   Backward normal branches
  3937.          000054 0044          ;
  3938.          000055 0044          ;   Only backward normal branches.
  3939.          000056 0044          ;
  3940.          000057 0044          ;   16 min  26 max  0 stack
  3941.          000058 0044          ;
  3942.          000059 0044          BCKBRA:
  3943.          000060 0044 47                ASRA
  3944.          000061 0045 2407              BCC  BCK010
  3945.          000062 0047 CE002A            LDX  #SIMPLE
  3946.          000063 004A 47                ASRA
  3947.          000064 004B 2406              BCC  BCK020
  3948.          000065 004D          BCKRET:
  3949.          000066 004D 39                RTS
  3950.          000067 004E          BCK010:
  3951.          000068 004E CE002F            LDX  #FWDBRA
  3952.          000069 0051 20FA              BRA  BCKRET
  3953.          000070 0053          BCK020:
  3954.          000071 0053 47                ASRA
  3955.          000072 0054 24F7              BCC  BCKRET
  3956.          000073 0056 CE0044            LDX  #BCKBRA
  3957.          000074 0059 39                RTS
  3958.  
  3959.  
  3960.  
  3961.          000075 005A          ;   Simple loop
  3962.          000076 005A          ;
  3963.          000077 005A          ;   A simple loop.
  3964.          000078 005A          ;
  3965.          000079 005A          ;   42 min  42 max  0 stack
  3966.          000080 005A          ;
  3967.          000081 005A          SIMPLOOP:
  3968.          000082 005A 8605              LDAA #5
  3969.          000083 005C          SIMP010:
  3970.          000084 005C 01                NOP
  3971.          000085 005D 4A                DECA
  3972.          000086 005E 26FC              BNE  SIMP010        ; TAKE 4
  3973.          000087 0060 39                RTS
  3974.  
  3975.  
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.                                         63          TimeStack User's Guide       Appendix A - Listing of Demo Program
  3991.  
  3992.  
  3993.  
  3994.          000088 0061          ;   Loop with backwards branch
  3995.          000089 0061          ;
  3996.          000090 0061          ;   Simple loop with a normal backwards
  3997.          000091 0061          ;   branch that terminates in middle.
  3998.          000092 0061          ;
  3999.          000093 0061          ;   62 min  62 max  0 stack
  4000.          000094 0061          ;
  4001.          000095 0061          BACKLOOP:
  4002.          000096 0061 8606              LDAA #6
  4003.          000097 0063          BACK010:
  4004.          000098 0063 4A                DECA
  4005.          000099 0064 2703              BEQ  BACKRET        ; FALL 5
  4006.          000100 0066 01                NOP
  4007.          000101 0067 20FA              BRA  BACK010
  4008.          000102 0069          BACKRET:
  4009.          000103 0069 39                RTS
  4010.  
  4011.  
  4012.  
  4013.          000104 006A          ;   Complex loop
  4014.          000105 006A          ;
  4015.          000106 006A          ;   A loop that will trigger the
  4016.          000107 006A          ;   complex loop message.
  4017.          000108 006A          ;
  4018.          000109 006A          ;   43 min  43 max  2 stack
  4019.          000110 006A          ;
  4020.          000111 006A          COMPLEX:
  4021.          000112 006A 8605              LDAA #5
  4022.          000113 006C          COMPL1:
  4023.          000114 006C 4A                DECA
  4024.          000115 006D 2704              BEQ  COMPX1    ; FALL 2
  4025.          000116 006F 4A                DECA
  4026.          000117 0070 26FA              BNE  COMPL1    ; TAKE 2
  4027.          000118 0072 39                RTS
  4028.          000119 0073          COMPX1:
  4029.          000120 0073 BD0076            JSR  COMPX2
  4030.          000121 0076          COMPX2:
  4031.          000122 0076 39                RTS
  4032.  
  4033.  
  4034.  
  4035.  
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  4045.  
  4046.  
  4047.  
  4048.                                         64          TimeStack User's Guide       Appendix A - Listing of Demo Program
  4049.  
  4050.  
  4051.  
  4052.          000123 0077          ;   Indirect jump test
  4053.          000124 0077          ;
  4054.          000125 0077          ;   Indirect jump that goes some
  4055.          000126 0077          ;   place and one that returns.
  4056.          000127 0077          ;
  4057.          000128 0077          ;   11 min  11 max  0 stack
  4058.          000129 0077          ;
  4059.          000130 0077          INDJMP:
  4060.          000131 0077 6E00              JMP  0,X  ; Destination JMPRET
  4061.          000132 0079 01                NOP
  4062.          000133 007A          JMPRET:
  4063.          000134 007A 38                PULX      ; Pull return address
  4064.          000135 007B 6E00              JMP  0,X  ; Indirect jump as RTS
  4065.  
  4066.  
  4067.  
  4068.          000136 007D          ;   Instruction not timeable
  4069.          000137 007D          ;
  4070.          000138 007D          ;   This can not be timed.
  4071.          000139 007D          ;
  4072.          000140 007D          ;   8 min  8 max  0 stack
  4073.          000141 007D          ;
  4074.          000142 007D          INSTIME:
  4075.          000143 007D 2701              BEQ  INST010   ; May be skipped
  4076.          000144 007F CF                STOP           ; Stop instruction
  4077.          000145 0080          INST010:
  4078.          000146 0080 39                RTS
  4079.  
  4080.  
  4081.  
  4082.          000147 0081          ;   Illegal instructions
  4083.          000148 0081          ;
  4084.          000149 0081          ;   These are illegal in demo.
  4085.          000150 0081          ;
  4086.          000151 0081          ;   8 min  8 max  0 stack
  4087.          000152 0081          ;
  4088.          000153 0081          ILLEGAL:
  4089.          000154 0081 2701              BEQ  ILL010    ; May be skipped
  4090.          000155 0083 3D                MUL
  4091.          000156 0084          ILL010:
  4092.          000157 0084 39                RTS
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103.  
  4104.  
  4105.  
  4106.                                         65          TimeStack User's Guide       Appendix A - Listing of Demo Program
  4107.  
  4108.  
  4109.  
  4110.          000158 0085          ;   Outer loop
  4111.          000159 0085          ;
  4112.          000160 0085          ;   Outer loop of nested loops.
  4113.          000161 0085          ;
  4114.          000162 0085          ;   482 min  482 max  3 stack
  4115.          000163 0085          ;
  4116.          000164 0085          OUTLOOP:
  4117.          000165 0085 8605              LDAA #5
  4118.          000166 0087          OUT010:
  4119.          000167 0087 36                PSHA
  4120.          000168 0088 BD0090            JSR  INLOOP
  4121.          000169 008B 32                PULA
  4122.          000170 008C 4A                DECA
  4123.          000171 008D 26F8              BNE  OUT010    ; TAKE 4
  4124.          000172 008F 39                RTS
  4125.  
  4126.  
  4127.  
  4128.          000173 0090          ;   Inner loop
  4129.          000174 0090          ;
  4130.          000175 0090          ;   Inner loop of nested loops.
  4131.          000176 0090          ;
  4132.          000177 0090          ;   77 min  77 max  0 stack
  4133.          000178 0090          ;
  4134.          000179 0090          INLOOP:
  4135.          000180 0090 860A              LDAA #10
  4136.          000181 0092          IN010:
  4137.          000182 0092 01                NOP
  4138.          000183 0093 4A                DECA
  4139.          000184 0094 26FC              BNE  IN010          ; TAKE 9
  4140.          000185 0096 39                RTS
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.                                         66          TimeStack User's Guide       Appendix A - Listing of Demo Program
  4165.  
  4166.  
  4167.  
  4168.          000186 0097          ;   Two loops
  4169.          000187 0097          ;
  4170.          000188 0097          ;   Two loops in one.
  4171.          000189 0097          ;
  4172.          000190 0097          ;   436 min  436 max  0 stack
  4173.          000191 0097          ;
  4174.          000192 0097          TWOLOOP:
  4175.          000193 0097 CE0005            LDX  #5
  4176.          000194 009A          TWO010:
  4177.          000195 009A 01                NOP
  4178.          000196 009B 860A              LDAA #10
  4179.          000197 009D          TWO020:
  4180.          000198 009D 01                NOP
  4181.          000199 009E 4A                DECA
  4182.          000200 009F 26FC              BNE  TWO020         ; TAKE 49
  4183.          000201 00A1          ;
  4184.          000202 00A1 09                DEX
  4185.          000203 00A2 26F6              BNE  TWO010         ; TAKE 4
  4186.          000204 00A4          ;
  4187.          000205 00A4 39                RTS
  4188.  
  4189.  
  4190.  
  4191.          000206 00A5          ;   Variable loops
  4192.          000207 00A5          ;
  4193.          000208 00A5          ;   Different loop times
  4194.          000209 00A5          ;
  4195.          000210 00A5          ;   211 min  211 max  2 stack
  4196.          000211 00A5          ;
  4197.          000212 00A5          VARLOOP:
  4198.          000213 00A5 8605              LDAA #5
  4199.          000214 00A7 BD00B4            JSR  DIFSUB         ; 30 cycles
  4200.          000215 00AA 860A              LDAA #10
  4201.          000216 00AC BD00B4            JSR  DIFSUB         ; 55 cycles
  4202.          000217 00AF 8614              LDAA #20
  4203.          000218 00B1 7E00B4            JMP  DIFSUB
  4204.          000219 00B4          ;
  4205.          000220 00B4          DIFSUB:
  4206.          000221 00B4 4A                DECA
  4207.          000222 00B5 26FD              BNE  DIFSUB         ; TAKE 19
  4208.          000223 00B7 39                RTS
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.                                         67          TimeStack User's Guide       Appendix A - Listing of Demo Program
  4223.  
  4224.  
  4225.  
  4226.          000224 00B8          ;   Stack Imbalance
  4227.          000225 00B8          ;
  4228.          000226 00B8          ;   Stack may become imbalanced
  4229.          000227 00B8          ;
  4230.          000228 00B8          ;   10 min  13 max  1 stack
  4231.          000229 00B8          ;
  4232.          000230 00B8          STKIMB:
  4233.          000231 00B8 01                NOP
  4234.          000232 00B9 2601              BNE  STK010
  4235.          000233 00BB 36                PSHA
  4236.          000234 00BC          STK010:
  4237.          000235 00BC 39                RTS
  4238.  
  4239.  
  4240.  
  4241.  
  4242.  
  4243.  
  4244.  
  4245.  
  4246.  
  4247.  
  4248.  
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.                                         68          TimeStack User's Guide    Appendix B - Warning and Error Messages
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.          Appendix B - Warning and Error Messages
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.          Warning Messages
  4306.  
  4307.                    Warning messages indicate that everything is OK but
  4308.                    that there may be something to watch out for or
  4309.                    additional information is needed.
  4310.  
  4311.                  A mismatch of the stack occurred
  4312.  
  4313.                    A conditional branch has two possible paths, the path
  4314.                    that results when the branch is taken and when it falls
  4315.                    through. This indicates that the stack depth is
  4316.                    different depending on which path is analyzed. It may
  4317.                    be possible for the stack to become unbalanced
  4318.                    depending on how the program works.
  4319.  
  4320.                  Backwards branch or jump at address %x
  4321.  
  4322.                    If a backwards branch or jump is encountered it is
  4323.                    possible for a loop to exist. This gives the user the
  4324.                    opportunity to review the program at this point to see
  4325.                    if a loop is in progress.
  4326.  
  4327.                  Branch at address %x was past the stop address
  4328.  
  4329.                    A branch encountered during the analysis branched past
  4330.                    the given stop address. The analysis results may not be
  4331.                    valid because this branch has not been fully explored.
  4332.                    It may also indicate that the stop address entered
  4333.                    should be higher to do a full analysis.
  4334.  
  4335.  
  4336.  
  4337.  
  4338.                                         69          TimeStack User's Guide    Appendix B - Warning and Error Messages
  4339.  
  4340.  
  4341.  
  4342.                  Indirect jump at address %x needs a destination
  4343.  
  4344.                    The address that an indirect jump goes to is needed to
  4345.                    complete the analysis.
  4346.  
  4347.                  Indirect jump subroutine at address %x needs cycle time
  4348.                    and stack depth
  4349.  
  4350.                    An indirect jump subroutine must have the maximum
  4351.                    number of clock cycles and maximum stack depth used by
  4352.                    the intended subroutine. This is more versatile than
  4353.                    entering an address to jump to.
  4354.  
  4355.                  The specified stop address %x was never reached
  4356.  
  4357.                    The stop address entered was not encountered during the
  4358.                    analysis. This usually happens when the stop address
  4359.                    entered is less than the start address. Another
  4360.                    possibility is that a return from subroutine was
  4361.                    encountered before the stop address entered and the
  4362.                    logic flow did not allow it to reach the given stop
  4363.                    address.
  4364.  
  4365.  
  4366.          Error Messages
  4367.  
  4368.                    An error message terminates the function being done. It
  4369.                    means some corrective action should be taken to fix the
  4370.                    problem.
  4371.  
  4372.                  Error list file is version %x
  4373.  
  4374.                    The special node file being read in has a version
  4375.                    number that does not match this version of TimeStack.
  4376.  
  4377.                  Error opening configuration file %s for reading
  4378.  
  4379.                    There is an error opening the given file for reading
  4380.                    and writing.
  4381.  
  4382.                  Error opening configuration file %s for writing
  4383.  
  4384.                    The configuration file has an error while opening it
  4385.                    for writing.
  4386.  
  4387.                  Error opening print file %s for writing
  4388.  
  4389.                    There is an error opening the given file for writing.
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.                                         70          TimeStack User's Guide    Appendix B - Warning and Error Messages
  4397.  
  4398.  
  4399.  
  4400.                  Error reading configuration file header
  4401.  
  4402.                    The first line of information in the configuration file
  4403.                    is bad. This usually means the file is not a valid
  4404.                    configuration file. Check the file name entered or the
  4405.                    configuration file being used.
  4406.  
  4407.                  Error with size of configuration file
  4408.  
  4409.                    The configuration file is too large to be valid. Check
  4410.                    to see that the given file is actually a configuration
  4411.                    file.
  4412.  
  4413.                  Error with the configuration version number
  4414.  
  4415.                    The configuration file has a version that is greater
  4416.                    then the program reading it. Use the correct version of
  4417.                    TimeStack that matches the configuration file.
  4418.  
  4419.                  Fatal internal error...
  4420.  
  4421.                    An error occurred in the internal logic of TimeStack.
  4422.                    This error should not occur in practice but is listed
  4423.                    here for completeness. If this error persists, write
  4424.                    down the details and contact BE, Inc.
  4425.  
  4426.                  File error opening %s
  4427.  
  4428.                    The file indicated was not found for the reason
  4429.                    specified.
  4430.  
  4431.                  Illegal opcode %x at address %x
  4432.  
  4433.                    The opcode at this address is not a valid instruction
  4434.                    for the current processor type. This might happen if a
  4435.                    hex file for another processor is loaded, the wrong
  4436.                    processor type was chosen, or an incorrect start
  4437.                    address has been entered.
  4438.  
  4439.                  One or both of the help files...
  4440.  
  4441.                    One or both of the indicated help files is missing or
  4442.                    can not be located by the TimeStack program. These
  4443.                    files are first looked for in the current drive and
  4444.                    directory. If they are not found there, each directory
  4445.                    specified in the PATH environment variable is searched
  4446.                    in turn until the files are found or the paths are
  4447.                    exhausted.
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454.                                         71          TimeStack User's Guide    Appendix B - Warning and Error Messages
  4455.  
  4456.  
  4457.  
  4458.                  The address %x is not an address loaded
  4459.  
  4460.                    The address encountered is not an address that was
  4461.                    loaded from the hex file. Unless it is loaded from the
  4462.                    hex file, the contents are undefined.
  4463.  
  4464.                  The analysis is limited by the amount of free memory
  4465.                    remaining
  4466.  
  4467.                    The analysis is limited by the amount of memory in the
  4468.                    system. Each jump subroutine and conditional branch
  4469.                    encountered requires a little bit more. This usually
  4470.                    means an infinite loop has been encountered or it may
  4471.                    mean a loop that occurs more times than TimeStack can
  4472.                    handle.
  4473.  
  4474.                  The analysis is limited by the stack depth
  4475.  
  4476.                    The analysis is limited by the amount of program stack
  4477.                    in the system. This can not be changed by the user.
  4478.                    Each jump subroutine and conditional branch encountered
  4479.                    requires a little bit more. This usually means an
  4480.                    infinite loop has been encountered. It may also mean a
  4481.                    loop has been set up and is taken more times than
  4482.                    TimeStack can handle.
  4483.  
  4484.                  The branch at address %x is involved in a difficult
  4485.                    structure
  4486.  
  4487.                    Some loop structures are too difficult to analyze
  4488.                    without some assistance. This is the branch that needs
  4489.                    to be set for the loop in question.
  4490.  
  4491.                  The file %s does not seem to be Motorola or Intel Hex
  4492.                    format
  4493.  
  4494.                    The letter S or a colon was not found to be the first
  4495.                    character in the first line of the file.
  4496.  
  4497.                  The file %s has a bad checksum
  4498.  
  4499.                    The checksum in one of the records in the hex file is
  4500.                    incorrect.
  4501.  
  4502.                  The file %s had no hex information
  4503.  
  4504.                    This file was scanned and identified as a Motorola or
  4505.                    Intel hex file but no hex data was found after that. It
  4506.                    probably is not a hex file at all.
  4507.  
  4508.  
  4509.  
  4510.  
  4511.  
  4512.                                         72          TimeStack User's Guide    Appendix B - Warning and Error Messages
  4513.  
  4514.  
  4515.  
  4516.                  The number of steps to execute a series of
  4517.                    instructions...
  4518.  
  4519.                    A series of instructions with no conditional branch to
  4520.                    divide it up has been encountered. This is probably an
  4521.                    infinite loop.
  4522.  
  4523.                  The opcode %x at address %x is not able to be analyzed
  4524.                    for time
  4525.  
  4526.                    The opcode at this address can not be logically
  4527.                    analyzed. This is usually an instruction like halt the
  4528.                    processor or wait for an interrupt to occur.
  4529.  
  4530.                  The processor type found in the configuration file...
  4531.  
  4532.                    The processor type found in the configuration file does
  4533.                    not match any of the processors that this version of
  4534.                    the TimeStack handles.
  4535.  
  4536.                  The processor type information was not found...
  4537.  
  4538.                    The configuration file must indicate what type of
  4539.                    processor TimeStack should use. This information is
  4540.                    missing.
  4541.  
  4542.                  Virtual file error writing %s
  4543.  
  4544.                    There was a problem writing to the temporary file
  4545.                    created on the disk. The most likely reason is that the
  4546.                    disk was full. The temporary files need at least 50K of
  4547.                    space when TimeStack runs.
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.                                         73          TimeStack User's Guide                   Appendix C - Key Summary
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.          Appendix C - Key Summary
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.                    F1             Obtains context sensitive on-line
  4595.                                   help.
  4596.  
  4597.                    F2             Edit address on top line of selected
  4598.                                   window.
  4599.  
  4600.                    F3             Select next window.
  4601.  
  4602.                    F4             Select previous window.
  4603.  
  4604.                    F5             Reserved for future use.
  4605.  
  4606.                    F6             Move and adjust selected window.
  4607.  
  4608.                    ALT-A          Analysis
  4609.  
  4610.                    ALT-C          Clear
  4611.  
  4612.                    ALT-D          Disasm
  4613.  
  4614.                    ALT-E          Edit
  4615.  
  4616.                    ALT-F          File
  4617.  
  4618.                    ALT-L          File | Load
  4619.  
  4620.                    ALT-O          Options
  4621.  
  4622.                    ALT-P          Print
  4623.  
  4624.                    ALT-Q          Quit
  4625.  
  4626.  
  4627.  
  4628.                                         74          TimeStack User's Guide                   Appendix C - Key Summary
  4629.  
  4630.  
  4631.  
  4632.  
  4633.                    ALT-R          File | Restore
  4634.  
  4635.                    ALT-S          File | Save
  4636.  
  4637.                    ALT-1 - ALT-6  Select the window with that number.
  4638.  
  4639.                    Home           Move to beginning of list in window or
  4640.                                   beginning of line.
  4641.  
  4642.                    CTRL-Home      Move to beginning of list in window.
  4643.  
  4644.                    End            Move to end of list in window or end
  4645.                                   of line.
  4646.  
  4647.                    CTRL-End       Move to end of list in window.
  4648.  
  4649.                    Pg Up          Move up one window's worth.
  4650.  
  4651.                    Pg Dn          Move down one window's worth.
  4652.  
  4653.                    Cur Up         Move up one line in window or pull
  4654.                                   down menu.
  4655.  
  4656.                    CTRL-Pg Up     Move up one line in window.
  4657.  
  4658.                    Cur Dn         Move down one line in window or pull
  4659.                                   down menu.
  4660.  
  4661.                    CTRL-Pg Dn     Move down one line in window.
  4662.  
  4663.                    Ins            Toggles insert mode when entering
  4664.                                   data.
  4665.  
  4666.                    Del            Deletes the character at the cursor
  4667.                                   position.
  4668.  
  4669.                    Backspace      Deletes the character just in front of
  4670.                                   the cursor.
  4671.  
  4672.                    Cur Left       Moves the cursor left one character.
  4673.  
  4674.                    Cur Right      Moves the cursor right one character.
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.                                         75          TimeStack User's Guide           Appendix D - Processor Specifics
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.          Appendix D - Processor Specifics
  4703.  
  4704.  
  4705.  
  4706.  
  4707.  
  4708.  
  4709.  
  4710.  
  4711.          TSDEMO
  4712.  
  4713.                    The processor used for the demo program is based on a
  4714.                    subset of the 68HC11 processor.
  4715.  
  4716.                    The default clock divisor value is four.
  4717.  
  4718.                    The following opcodes have been removed:
  4719.  
  4720.                    * any instruction that requires a PREBYTE
  4721.  
  4722.                    * all special instructions such as MUL, FDIV, IDIV
  4723.  
  4724.                    * everything that operates on registers B, D, or Y
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.                                         76          TimeStack User's Guide           Appendix D - Processor Specifics
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.          TS6811
  4751.  
  4752.                    The default clock divisor value is four.
  4753.  
  4754.                  6800
  4755.  
  4756.                    The processors that fall in this category are:
  4757.                    6800.
  4758.  
  4759.                  6801
  4760.  
  4761.                    The processors that fall in this category are:
  4762.                    6801, 6801U4, 68701, 68701U4.
  4763.  
  4764.                  6802
  4765.  
  4766.                    This processor is identical to the 6800 for the purpose
  4767.                    of analysis. It has a separate entry for labeling
  4768.                    purposes.
  4769.  
  4770.                    The processors included in this category are:
  4771.                    6802.
  4772.  
  4773.                  6803
  4774.  
  4775.                    These processors are identical to the 6801 for the
  4776.                    purpose of analysis. It has a separate entry for
  4777.                    labeling purposes.
  4778.  
  4779.                    The processors that fall in this category are:
  4780.                    6803, 6803U4.
  4781.  
  4782.                  68HC11
  4783.  
  4784.                    The processors that fall in this category are:
  4785.                    68HC11A0,  68HC11A1,  68HC11A7,  68HC11A8,
  4786.                    68HC11D0,  68HC11D3,  68HC11E0,  68HC11E1,
  4787.                    68HC11E2,  68HC11E8,  68HC11E9,  68HC11F1,
  4788.                    68HC11L0,  68HC11L1,  68HC11L5,  68HC11L6,
  4789.                    68HC711D3, 68HC711E9, 68HC711K4, 68HC711J6,
  4790.                    68HC711L6.
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.                                         77          TimeStack User's Guide           Appendix D - Processor Specifics
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.          TS6805
  4809.  
  4810.                    There are a very large number of different 6805
  4811.                    variations but for timing purposes they fall into three
  4812.                    categories. These are HMOS, HCMOS, and CMOS. If a
  4813.                    specific processor has not been mentioned it should be
  4814.                    obvious where it should be placed by looking at its
  4815.                    number.
  4816.  
  4817.                  6805 HMOS
  4818.  
  4819.                    The default clock divisor value is four.
  4820.  
  4821.                    The HMOS processors that fall in this category are:
  4822.                    6805P2,  6805P6,  6805R2,  6805R3,  6805R6,
  4823.                    6805S2,  6805S3,  6805U2,  6805U3,  68705P3,
  4824.                    68705P5, 68705R3, 68705R5, 68705S3, 68705U3,
  4825.                    68705U5.
  4826.  
  4827.                  68HC05 HCMOS
  4828.  
  4829.                    The default clock divisor value is two.
  4830.  
  4831.                    The HCMOS processors that fall in this category are:
  4832.                    68HC05A6,  68HC05B4,  68HC05B6,   68HC05C2,
  4833.                    68HC05C3,  68HC05C4,  68HC05C5,   68HC05C8,
  4834.                    68HC05C9,  68HC05D9,  68HC05E0,   68HC05E1,
  4835.                    68HC05J1,  68HC05L6,  68HC05L7,   68HC05L9,
  4836.                    68HC05M4,  68HC05P1,  68HC05P4,   68HC05P7,
  4837.                    68HC05P8,  68HC05P9,  68HC05SC11, 68HC05SC21,
  4838.                    68HC05T1,  68HC05T2,  68HC05T7,   68HCL05C4,
  4839.                    68HCL05C8, 68HSC05C4, 68HSC05C8,  68HC705B5,
  4840.                    68HC705C8, 68HC705J2, 68HC705P9,  68HC805B6,
  4841.                    68HC805C4.
  4842.  
  4843.                  146805 CMOS
  4844.  
  4845.                    The default clock divisor value is four.
  4846.  
  4847.                    The CMOS processors that fall in this category are:
  4848.                    146805E2, 146805F2, 146805G2.
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.                                         78          TimeStack User's Guide           Appendix D - Processor Specifics
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.          TS8051
  4867.  
  4868.                    The default clock divisor value is twelve.
  4869.  
  4870.                    The disassembler for this family of processors will
  4871.                    show the internal register names and bits.
  4872.  
  4873.                  8051
  4874.  
  4875.                    The processors that fall in this category are:
  4876.                    8051, 8052, 8751.
  4877.  
  4878.                  8031
  4879.  
  4880.                    This processor is identical to the 8051 for the purpose
  4881.                    of analysis. It has a separate entry for labeling
  4882.                    purposes.
  4883.  
  4884.                    The processors that fall in this category are:
  4885.                    8031, 8032.
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.  
  4892.  
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.                                         79          TimeStack User's Guide           Appendix D - Processor Specifics
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.          TS8048
  4925.  
  4926.                    The 8048 processors handle extended program memory in a
  4927.                    special way. For programs of 2K bytes or less, program
  4928.                    memory may be addressed in a conventional manner.
  4929.                    Address above 2K can be reached by executing a program
  4930.                    memory bank switch instruction (SEL MB0 or SEL MB1)
  4931.                    followed by a branch instruction such as JMP or CALL. A
  4932.                    bit called DBF (memory bank flip-flop) contains the
  4933.                    setting of the last SEL MB0 or SEL MB1 instruction. All
  4934.                    JMP's and CALL's use this bit to determine which memory
  4935.                    bank (lower 2K or upper 2K) to execute from.
  4936.  
  4937.                    The problem is when the analysis begins it is not known
  4938.                    what state the DBF bit should be set to. This is
  4939.                    handled by initially setting the DBF bit to match the
  4940.                    memory bank of the start address given in the analysis.
  4941.  
  4942.                    Another minor issue is that of indirect jumps. The
  4943.                    range is limited to 256 bytes but the program will
  4944.                    allow a 16-bit address to be entered.
  4945.  
  4946.                    The stack depth of the 8048 processors allows a nesting
  4947.                    level of eight. After that the stack pointer wraps
  4948.                    around and the oldest return address is lost. The
  4949.                    TimeStack analysis does not detect this.
  4950.  
  4951.                  8048 family
  4952.  
  4953.                    The default clock divisor value is fifteen.
  4954.  
  4955.                    The processors that fall in this category are:
  4956.                    8035, 8039, 8040, 8048, 8049, 8050, 8748, 8749.
  4957.  
  4958.                  8021/8020
  4959.  
  4960.                    The default clock divisor value is thirty.
  4961.  
  4962.                    The processors that fall in this category are:
  4963.                    8021, 8020.
  4964.  
  4965.                  8022
  4966.  
  4967.                    The default clock divisor value is thirty.
  4968.  
  4969.                    The processors that fall in this category are:
  4970.                    8022.
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.                                         80          TimeStack User's Guide                                      Index
  4977.  
  4978.  
  4979.  
  4980.          Index                                different processors, 27
  4981.  
  4982.                                             Bytes
  4983.                                               memory usage, 45
  4984.  
  4985.  
  4986.          - 6 -                              - C -
  4987.  
  4988.          6800, 77                           Clear, 16
  4989.  
  4990.          6805, 78                           Clock
  4991.                                               changing clock divisor, 17
  4992.          6811, 77                             changing rate, 16
  4993.                                               cycles, 45
  4994.                                               demo program, 37
  4995.          - 8 -
  4996.                                             Command line
  4997.          8048, 80                             syntax, 7
  4998.  
  4999.          8051, 79                           Comment
  5000.                                               added to print, 18
  5001.  
  5002.          - A -                              Complex loops, 48
  5003.  
  5004.          Addresses, see also Start and      Concepts
  5005.          stop                                 timing, 31
  5006.            entering, 12
  5007.                                             Conditional branch
  5008.          Analysis, 14, see also Timing        description, 31
  5009.            demo program, 38                   different processors, 27
  5010.            window, 21                         edit, 15
  5011.                                               fall, 32
  5012.          Assembly language, see Source        forcing, 60
  5013.          code                                 inside subroutine, 39
  5014.                                               normal, 32
  5015.          Autoexec.bat, see                    take, 31
  5016.          Configuration
  5017.                                             Configuration
  5018.          Automatically save                   autoexec.bat, 7
  5019.            demo configuration, 37             automatically save, 17
  5020.                                               demo program, 37
  5021.                                               file, 14, 29
  5022.          - B -                                get, 14
  5023.                                               put, 14
  5024.          BE, Inc.                             system requirements, 6
  5025.            how to contact, 5
  5026.                                             Cycles
  5027.          Branch                               clock, 45
  5028.            past stop address, 58
  5029.  
  5030.          Branch relative
  5031.  
  5032.  
  5033.  
  5034.                                         81          TimeStack User's Guide                                      Index
  5035.  
  5036.  
  5037.  
  5038.          - D -                                F5, Reserved for future
  5039.                                               use, 22
  5040.          Demo program                         F6 - Move or size window,
  5041.            configuration, 37                  23
  5042.            invoking, 36
  5043.            limitations, 27
  5044.            processor specifics, 76          - H -
  5045.  
  5046.          DEMO.HEX, 36                       Help
  5047.                                               on-line, 24
  5048.          Disasm, 16
  5049.            window, 20                       Hex file, 13
  5050.                                               description, 27
  5051.                                               Intel, 28
  5052.          - E -                                load, 13
  5053.                                               load DEMO.HEX, 37
  5054.          Edit, 15                             Motorola, 28
  5055.            conditional branch, 15             possible errors, 29
  5056.            jump indirect, 16
  5057.            jump to subroutine, 15           High level languages, 60
  5058.  
  5059.          Error messages, 70                 Hot keys
  5060.                                               Alt-1 - Alt-6, Select
  5061.                                               window, 23
  5062.          - F -                                Alt-A, Analysis, 14, 23
  5063.                                               Alt-C, Clear, 16, 23
  5064.          Fall, see Conditional branch         Alt-D, Disasm, 16, 23
  5065.                                               Alt-E, Edit, 15, 23
  5066.          File, 13, see also Node file         Alt-F, File, 13, 23
  5067.            get, 14                            Alt-L, Load, 13, 23
  5068.            load, 13                           Alt-O, Options, 16, 23
  5069.            put, 14                            Alt-P, Print, 17, 23
  5070.            restore, 13                        Alt-Q, Quit, 19, 23
  5071.            save, 13                           Alt-R, Restore, 13, 23
  5072.                                               Alt-S, Save, 13, 23
  5073.          Filenames
  5074.            entering, 11
  5075.                                             - I -
  5076.          Files, see also Configuration,
  5077.          see also Temporary files           Illegal instructions, 51
  5078.  
  5079.          Forcing                            Indirect jump, see also Jump
  5080.            conditional branches, 60         indirect, 50
  5081.  
  5082.          Function keys                      Infinite loops, 57
  5083.            F1, Help, 22
  5084.            F2, Edit top item, 22, 60        Information
  5085.            F3, Select next window, 22         get summary, 37
  5086.            F4, Select previous window,
  5087.            22                               Installation
  5088.                                               performing, 6
  5089.  
  5090.  
  5091.  
  5092.                                         82          TimeStack User's Guide                                      Index
  5093.  
  5094.  
  5095.  
  5096.          Instructions                       - L -
  5097.            illegal, 51
  5098.            untimeable, 51                   Languages, 60
  5099.  
  5100.          Intel                              Limitations
  5101.            8048, 80                           demo program, 27
  5102.            8051, 79                           memory, 58
  5103.            hex file, 28
  5104.                                             Listing
  5105.                                               description, 29
  5106.          - J -                                have it ready, 45
  5107.                                               looking it over, 36
  5108.          Jump
  5109.            different processors, 27         Loading
  5110.                                               DEMO.HEX, 37
  5111.          Jump indirect, 35                    TimeStack, 8
  5112.            as return from subroutine,
  5113.            35                               Loops
  5114.            different processors, 27           complex, 48
  5115.            edit, 16                           description, 32
  5116.                                               exit at bottom, 33, 41
  5117.          Jump to subroutine                   exit in middle, 33, 42
  5118.            different processors, 27           infinite, 57
  5119.            edit, 15                           inside other loops, 54
  5120.                                               inside subroutines, 52
  5121.                                               nested, 52
  5122.          - K -
  5123.  
  5124.          Key                                - M -
  5125.            summary, 74
  5126.                                             Maximum execution
  5127.          Keys, see also Function keys,        strategy, 45
  5128.          see also Hot keys                    window, 21
  5129.            Backspace, 24
  5130.            Ctrl-End, 24                     Memory
  5131.            Ctrl-Home, 23                      limitations, 58
  5132.            Ctrl-Pg Dn, 24
  5133.            Ctrl-Pg Up, 24                   Menus, see also individual
  5134.            Cur Dn, 24                       menu names
  5135.            Cur Left, 24                       entering filenames, 11
  5136.            Cur Right, 24                      entering numbers, 12
  5137.            Cur Up, 24                         operation of, 10
  5138.            Del, 24                            screen layout, 9
  5139.            End, 23                            selections, 13
  5140.            Home, 23                           status line, 11
  5141.            Ins, 24
  5142.            Pg Dn, 24                        Minimum execution
  5143.            Pg Up, 24                          strategy, 45
  5144.                                               window, 22
  5145.  
  5146.                                             Mnemonics
  5147.  
  5148.  
  5149.  
  5150.                                         83          TimeStack User's Guide                                      Index
  5151.  
  5152.  
  5153.  
  5154.            differences, 26                    path to printer, 18
  5155.                                               results, 43, 60
  5156.          Motorola
  5157.            6800, 77                         Processor
  5158.            6805, 78                           6800, 77
  5159.            6811, 77                           6805, 78
  5160.            hex file, 28                       6811, 77
  5161.                                               8048, 80
  5162.                                               8051, 79
  5163.          - N -                                demo program type, 37, 76
  5164.                                               display of type, 16
  5165.          Node file, 13
  5166.            automatically save, 17, 19       Program listing, see Listing
  5167.            description, 30
  5168.            restore, 13                      Program loops, see Loops
  5169.            save, 13
  5170.                                             Program names, 7
  5171.          Nodes
  5172.            clearing, 16
  5173.            editing, 15                      - Q -
  5174.            window, 20
  5175.                                             Quit, 19, 44
  5176.          Normal, see Conditional branch
  5177.  
  5178.          Numbers                            - R -
  5179.            bases, 12
  5180.            entering, 12                     README, 6
  5181.            prefixes and postfixes, 12
  5182.                                             Registration
  5183.                                               user registration, 5
  5184.          - O -
  5185.                                             Relative branch, see Branch
  5186.          Options, 16                        relative
  5187.            clock rate, 16
  5188.            config, 17                       Return from subroutine, see
  5189.            divisor for clock, 17            also Subroutine
  5190.            get, 17                            different processors, 27
  5191.            node, 17                           stop address, 15
  5192.            type of processor, 16              using jump indirect, 35
  5193.  
  5194.                                             Running
  5195.          - P -                                TimeStack, 8
  5196.  
  5197.          Prefixes and Postfixes
  5198.            entering numbers, 12             - S -
  5199.  
  5200.          Print, 17                          Save
  5201.            comment, 18                        results to file, 60
  5202.            disasm to file, 18
  5203.            disasm to printer, 18            Screen, see Menus or Windows
  5204.            path to file, 18
  5205.  
  5206.  
  5207.  
  5208.                                         84          TimeStack User's Guide                                      Index
  5209.  
  5210.  
  5211.  
  5212.          Simulator                          - T -
  5213.            comparison with TimeStack,
  5214.            2                                Take, see Conditional branch
  5215.            definition, 2
  5216.                                             Temporary files, 30
  5217.          Source code
  5218.            format, 25                       TimeStack
  5219.            mnemonic differences, 26           benefits of using, 1
  5220.                                               comparison with simulator,
  5221.          Special nodes                        2
  5222.            window, 20                         loading and running, 8
  5223.                                               program names, 7
  5224.          Stack depth                          tutorial, 36
  5225.            description, 35
  5226.            imbalance, 56                    Timing, see also Loops
  5227.            strategy, 45                       concepts, 31
  5228.            window, 22                         indirect jump, 50
  5229.                                               multiple paths, 47
  5230.          Start address                        strategy, 45
  5231.            examples, 39                       subroutines, 55
  5232.  
  5233.          Start and stop                     TPDEMO, 36, 48
  5234.            description, 30
  5235.            entering, 14
  5236.                                             - U -
  5237.          Status line, 11
  5238.                                             User registration, see
  5239.          Stop address                       Registration
  5240.            actual, 59
  5241.            branch past, 58
  5242.            examples, 39                     - W -
  5243.  
  5244.          Strategy, see Timing               Warning messages, 69
  5245.  
  5246.          Subroutines                        Windows
  5247.            conditional branches, 39           analysis results, 21
  5248.            description, 34                    description, 19
  5249.            different execution times,         disassembly, 20
  5250.            55                                 display of subroutines, 20
  5251.            entering execution time, 34        maximum execution, 21
  5252.            entering stack depth, 34           minimum execution, 22
  5253.            indirect, 34                       moving and sizing, 19
  5254.            loops inside of, 52                screen layout, 9
  5255.            return from, 34                    selecting, 19
  5256.            simple timing, 38                  special nodes, 20
  5257.                                               stack depth, 22
  5258.          Syntax                               status line, 11
  5259.            command line, 7
  5260.  
  5261.          System
  5262.            requirements, 6
  5263.  
  5264.  
  5265.  
  5266.                                         85
  5267.